# king-addons/51.1.87/includes/widgets/Woo_Checkout_Coupon/script.js

King Addons for Elementor – 100+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce Builder, Mega Menu, Popup Builder, version 51.1.87. 22 lines.

- Page: https://pluginprobe.com/plugins/king-addons/51.1.87/code/includes/widgets/Woo_Checkout_Coupon/script.js
- Raw: https://pluginprobe.com/plugins/king-addons/51.1.87/raw/includes/widgets/Woo_Checkout_Coupon/script.js
- Modified: 2026-09-28T10:54:44+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/king-addons/51.1.87/code/includes/widgets/Woo_Checkout_Coupon/script.js#L10-L20`.

```javascript
/**
 * Checkout Coupon widget: open the coupon form when the notice banner is tapped.
 *
 * WooCommerce only binds a.showcoupon. On narrow viewports the link wraps, so
 * most of the banner's hit area is the parent div and the form stays closed.
 */
(function ($) {
    'use strict';

    $(document).on('click', '.ka-woo-checkout-coupon .woocommerce-form-coupon-toggle', function (event) {
        if (event.target.closest('a.showcoupon')) {
            return;
        }
        const link = this.querySelector('a.showcoupon');
        if (!link) {
            return;
        }
        event.preventDefault();
        link.click();
    });
})(jQuery);

```
