I have following HTML:
<input type="checkbox" value="1" class="trchoose">
<input type="checkbox" value="1" class="trchoose">
<input type="checkbox" value="1" class="trchoose">
<input type="checkbox" value="1" class="trchoose">
and following is my jQuery code:
jQuery('.trchoose').click(function() {
alert('');
res= jQuery(this).attr('class');
alert(res);
});
Now I need to get value of the particular checkbox which was clicked. The above code of jQuery is not working.
What am I doing wrong?
this.valueor$(this).val()plus you're missingvar$(document).ready()