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

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -