SCRIPT5007: 无法获取未定义或 null 引用的属性“checked” checked在js中,从后面找好找点。谢谢各位!
-<!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>HANYULIANXI</title>
<link href="file:///G|/4.24/hanyu/han.js" rel="stylesheet" type="text/css" />
</head>

<body>
<div id="a">
  <div align="center">元素演示区域 </div>
</div><br />

用户名:<input name="" id="1" type="text" onfocus="focus_clean(this)" />
密码:<input name="" id="2" type="password" onfocus="focus_clean(this)" />
<br />
<table width="662" border="0">
  <tr>
    <td width="323">常去网站:<p>
    <label >
      <input type="checkbox" name="CheckboxGroup1" value="1" id="CheckboxGroup1_0" />
      CSDN</label>

    <label>
      <input type="checkbox" name="CheckboxGroup1" value="2" id="CheckboxGroup1_0" />
      MSDN</label>

    <label>
      <input type="checkbox" name="CheckboxGroup1" value="3" id="CheckboxGroup1_0" />
      新闻网</label>
     <br />

    <label>
      <input type="checkbox" name="CheckboxGroup1" value="4" id="CheckboxGroup1_0" />
      计世网</label>

    <label>
      <input type="checkbox" name="CheckboxGroup1" value="5" id="CheckboxGroup1_0" />
      教程网</label>


    <br />
  </p>&nbsp;</td>
    <td width="323">  默认搜索:
<p> <label>
        <input type="radio" name="RadioGroup1" value="1" id="RadioGroup1_0" />
        baidu</label>

      <label>
        <input type="radio" name="RadioGroup1" value="2" id="RadioGroup1_0" />
        google</label>
      <br />
      <label>
        <input type="radio" name="RadioGroup1" value="3" id="RadioGroup1_0" />
        yahoo</label>

      <label>
        <input type="radio" name="RadioGroup1" value="4" id="RadioGroup1_0" />
        MSN</label>
      <br />
<br /></p>
 &nbsp;</td>
  </tr>
</table>

<table width="662">
  <tr>
    <td width="325">掌握的技能:<br />

<select size="6" multiple="MULTIPLE" id="jj">
  <option value="1" >ASP网站开发</option>

  <option value="2">Access和SQL Server</option>
  <option value="3">ASP.NET网站开发</option>
  <option value="4">ADO.NET编程</option>
  <option value="5" >XML应用</option>
  <option value="6">DIV+CSS</option>
</select>&nbsp;</td>
    <td width="325">最想了解的技术:<br />

<select>
  <option value="1" id="ss">设计模式</option>
</select>

<br />&nbsp;</td>
  </tr>
</table>
<input name="" type="button" value="提交" onclick=" tijiao()"
/>

<input name="" type="reset" value="重置"   /><br />
&nbsp;
您输入的信息为:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<textarea cols="" rows="" " id="tex" onfocus="focus_clean(this)"></textarea>
<script language="javascript">
function focus_clean(a)
{
    a.value="";
}
var Name=document.getElementById("1");
var PW=document.getElementById("2");
var CG=document.getElementById("CheckboxGroup1_0");
var RG=document.getElementsByName("RadioGroup1");
var Txa=document.getElementById("txa");
var AA=document.getElementById("jj");
var DD=document.getElementById("ss");

    function tijiao()
{
    tex.value=Name.value+"\n"+PW.value+"\n"+AA.value+"\n"+DD.value+"\n";
    var checked;
    for(var i=0;i<5;i++)
    {
        if(CG[i].checked)
            tex.value+=CG[i].value+" ";
    }

        for(var i=0;i<4;i++)
    {
        if(RG[i].checked)
            tex.value+=RG[i].value+" ";
    }
        for(var i=0;i<6;i++)
    {
        if(DD[i].checked)
            tex.value+=DD[i].value+" ";
    }

}
</script>
</body>
</html>

`

qq_43923241
某位青年 回复贵阳三中马老师教你解析几何: 现在可以看见了吗
一年多之前 回复
caozhy
贵阳老马马善福专业维修游泳池堵漏防水工程 请你先把代码贴正确
一年多之前 回复
qq_43923241
某位青年 还有就是,应该怎么清空表单中的内容!
一年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问