Home > Net >  How can I make the checkbox checkbox enabled by default?
How can I make the checkbox checkbox enabled by default?

Time:03-17

How can I make the checkbox checkbox enabled by default? here is the code

<label  data-automation-id="woo-commerce-subscription-opt-in">
                        <input type="checkbox"  name="mailpoet_woocommerce_checkout_optin" id="mailpoet_woocommerce_checkout_optin" value="1"> I have read and agree to the site terms and conditions *<span >(necessarily)</span></label>

CodePudding user response:

You can use Jquery i.e.

$('#your_checkbox_id').prop('checked', true);

CodePudding user response:

Just add checked

<input type="checkbox"  name="mailpoet_woocommerce_checkout_optin" id="mailpoet_woocommerce_checkout_optin" value="1" checked>
  • Related