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

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -