日期:2014-05-18 浏览次数:20715 次
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript"> window.onload=function(){ var wsgpTag = document.getElementById("wsgp"); if(wsgpTag.checked){// 一打开网页,如果被选中 wsgpTag.value="Y"; }else{ wsgpTag.value="N"; } alert(wsgpTag.value); } function changeValue(){ var wsgpTag = document.getElementById("wsgp"); if(wsgpTag.checked){// 重新改变是否选中,如果被选中 wsgpTag.value="Y"; }else{ wsgpTag.value="N"; } alert(wsgpTag.value); } </script> </head> <body> <center> <form action=""> <input type="checkbox" name="wsgp" id="wsgp" value="Y" onclick="changeValue();" checked="checked"/>网上登记 </form> </center> </body> </html>