I need to access to a value in a checkbox, the atribute value has content, so i need to place the id somewhere else i created a label, but i have not access to that value
alert(check[i].label); // doesnt work
where else can i place a value in checkbox.
Please dont write that i can do this
<input type='checkbox' id='bla' name='mybla' vlaue='myvalue'> Hy
Where can i place some other values ?
I tryed with this
<input type='checkbox' id='bla' name='mybla' vlaue='myvalue' label='myothervalue'> Hy
first i get all checkbox ect… and in the for loop i did this
alert(check[i].label); // doesnt work
How can i do that?
It is indeed possible to store the extra data as a custom attribute on the
<input>element. When you want to read the value, you can do it like this:Since you have tagged the question jQuery, here’s the trendy version:
See these discussions if you are woried about using custom HTML attributes.