javascript - Radio button value regardless of selected input -
i have code:
<input type="radio" name="pay" id="payid" value="banktransfer"> bank transfer <br/> <input type="radio" name="pay" id="payid" value="paypal"> paypal <br/> <br/>
i try:
var sample = $('#payid').val() alert(sample);
why have still banktransfer
? (regardless of selected input)?
the id must unique. radios need same name on-off functionality work, each must have unique id. could, instance, have "payid1" , "payid2"
Comments
Post a Comment