If I assign a “value” to a radio button to use that “value” in my script programming and suppose that value is assigned to a image and the code looks like this
<input type="radio" name="image" value="500"/><img src="1.png">
<input type="radio" name="image" value="500"/><img src="2.png">
<input type="radio" name="image" value="500"/><img src="2.png">
How can I identify which image is which?
I want to identify that user has selected which image, but my constraint is this that the value for all images will be the same.. and since it is a radio so name will be same for all in a same radio group.. what else??
Thanks in advance.
Give an id to each input item. Then check using
document.getElementById("radio1").checked