Vyshnavi Samudrala Vyshnavi Samudrala - 1 year ago 155
HTML Question

Check radio button on button click inside the label

Clicking on label checks the radio button but not on click of a button inside that label

Check the example


<input id="349" type="radio" value="1" name="question1">
<label for="349"><button type="button"> Abe </button></label>
<input id="350" type="radio" value="2" name="question1">
<label for="350">Andrew</label>

Answer Source

You could add an onclick event to the button in question and link it to the input radio tag.

function abe() {

Here is a sample fiddle: http://jsfiddle.net/r2masf5t/

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download