Ich versuche, Woocommerce Produktvariationsfeld erforderlich Ich legte das Balg Skript vor </head>
, aber funktioniert nicht.Wie "erforderlich" in WooCommerce Variation hinzufügen Option wählen
Wie kann ich das tun?
Es funktioniert auf aber nicht in meiner Website, was ich falsch mache.
Mein HTML:
<select id="color" class="" name="attribute_color" data-attribute_name="attribute_color">
<option value="" selected="selected">Choose an option</option>
<option value="White" class="attached enabled">White</option>
<option value="Black" class="attached enabled">Black</option>
</select>
My Script:
$(document).ready(function() {
$('select').prop("required", true);
});
Dank.
Wow es funktioniert Danke P – Firefog