Suppose this code:
<input id="myinpunt-name" my_attribute="1" class="myclass" ...
<checkbox id="myinpunt-name" my_attribute="2" class="myclass" ...
$('.myclass').change(function() {
dosomething($(this).attr('my_attribute'));
});
and works correctly.
Now I have also another component
<select id="myselect-name" my_attribute = /* here I want to read Value*/ class="myclass" ...
In this case my_attribute
has to read $(this).val()
.
In there a way to set value
attribute to a custom attribute ?
thanks.