<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script src="jquery.js" type="text/javascript"></script><script>$(function(){     var val = $("input[name='my']").val();
 alert(val);})
</script>
</head><body>
<script></script>
<input type="radio" value="1" name="my"/>1
<input type="radio" value="2" name="my" checked="checked"/>2
<input type="radio" value="3" name="my"/>3
<input type="radio" value="4" name="my"/>4
<input type="radio" value="5" name="my"/>5</body>
</html>

解决方案 »

  1.   

     $("input[name='my'][checked]").val();
    这样获取
      

  2.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 
    <html> 
    <head> 
         <meta http-equiv="Content-Type" c/> 
         <script type="text/javascript" src="jquery.js"> 
        </script> 
         <script type="text/javascript"> 
             $(function(){ 
                 $('#form1').submit(function(){ 
                     var item = $('input[@name=items][@checked]').val(); 
                     alert(item); 
                     return false; 
                 }); 
             }); 
         </script> 
         <title>Get Radio value Document</title> 
    </head> 
    <body> 
         <form id="form1"> 
             <input type="radio" name="items" id="item1" value="a"/>A 
             <br/> 
             <input type="radio" name="items" id="item2" value="b"/>B 
             <br/> 
             <input type="radio" name="items" id="item3" value="c"/>C 
             <br/> 
             <input type="radio" name="items" id="item4" value="d"/>D 
             <br/> 
             <input type="radio" name="items" id="item5" value="e"/>E 
             <br/> 
             <input type="radio" name="items" id="item6" value="f"/>F 
             <br/> 
             <input type="radio" name="items" id="item7" value="g"/>G 
             <br/> 
             <input type="radio" name="items" id="item8" value="h"/>H 
             <br/> 
             <input type="submit" id="btn1"> 
         </form> 
    </body> 
    </html>