<html xmlns="http://www.w3.org/1999/xhtml"><head> <title></title> <script type="text/javascript"> function che() { alert(); } </script></head><body><form name="rad" method="post" action="#"><div><p><input type="radio" value="1" name="r"/>1</p><p><input type="radio" value="2" name="r"/>2</p></div><input type="button" value="check" onclick="che()"/></form></body></html>
<html xmlns="http://www.w3.org/1999/xhtml"><head> <title></title> <script type="text/javascript"> function che() { var rs = document.getElementsByName('r'); for (var i = 0, len = rs.length; i < len; i++) { if (rs[i].checked) { alert(rs[i].value); break; } } } </script></head><body><form name="rad" method="post" action="#"><div><p><input type="radio" value="1" name="r"/>1</p><p><input type="radio" value="2" name="r"/>2</p></div><input type="button" value="check" onclick="che()"/></form></body></html>
jquery code