php - Jquery get value of radio button -



php - Jquery get value of radio button -

here's html mark up

<span class="wpcf7-form-control-wrap radio-20"> <span class="wpcf7-radio radio-20" id="radio-20"> <span class="wpcf7-list-item"> <span class="wpcf7-list-item-label">yes</span> <input type="radio" value="yes" name="radio-20"> </span> <span class="wpcf7-list-item"> <span class="wpcf7-list-item-label">no</span> <input type="radio" value="no" name="radio-20"> </span> </span> </span>

how know of "yes" radio button or "no" checked?

i tried:

jquery("span#radio-20 span input").val("yes").click(function (){ alert('bang!'); });

but alert when click "no";

can help me?

jquery("span#radio-20 span input[value=yes]").click(function (){ alert('bang!'); });

php javascript jquery wordpress

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -