I have two divs containing the same checkbox with the same name,class and id. When I am selecting the checkbox of a particular div , it should alert the value of that checkbox when submitting a button.
Example :
<div>
<input type="checkbox" class="snowplay" id="snowplayy" name="snowplay" value="1">
</div>
<div>
<input type="checkbox" class="snowplay" id="snowplayy" name="snowplay" value="2">
</div>
<div>
<input type="submit" class="submit" id="submit" name="submit" />
</div>
When I am clicking any of the two checkboxes, and then submitting the button, I want to alert the value of the checkbox of that particular checkbox. Can anyone say how to do this ?
ID should be unique