onclick传递参数

  1. <html>  
  2. <head>  
  3. <script language="javascript">  
  4. function test(value){  
  5.         if(value=='1') {  
  6.                 alert("11111111");  
  7.         }else{  
  8.                 alert("00000000");  
  9.         }  
  10. }  
  11. </script>  
  12. </head>  
  13.   
  14. <body>  
  15. <form name="form1" method="post" action="">  
  16.   <input type="radio" name="ra" value="1" onclick="test(this.value)"/>  
  17.   个人  
  18.   <input type="radio" name="ra" value="0" onclick="test(this.value)""/>  
  19.   公司  
  20. </form>  
  21. </body>  
  22. </html>  

posted on 2018-04-07 16:09  David_Deng  阅读(10228)  评论(0编辑  收藏  举报

导航