javascript - Selection radio button -


Stuck slightly on where to go from I would like my radio buttons to return the value of the selected button but Right now, it only returns the price of the first item. How can I find it through all the values, this is my code. <

   

  & lt; Script & gt; Function myFunction () {var x = document.getElementsByName ('os'); Var rate_value; {If (x [i] is checked for (var i = 0; i & lt; x.length; i ++) {rate_value = x [i] .value; break; }} Document.getElementById ("Demo"). InnerHTML = rate_value; } & Lt; / Script & gt;  


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -