For example I have several checkboxes.
<input type="checkbox" value="27" name="option_value[12][]" id="option_value_27" class="filtered option_value" cat="121">
<input type="checkbox" value="27" name="option_value[12][]" id="option_value_27" class="filtered option_value" cat="141">
Two questions:
- Is the declaration of
catattribute valid? - How can I get access to
catattribute value for example when I click on button?
data-*attributes are only valid if you plan to use an HTML5 doctype. Having said that, your example really sucks –values andids are the same