js checkbox 问题!!!急 。。。。
jsp 页面:
<table width="500" height="450">
				<tr><th colspan="4" height="24">业务员列表</th></tr>
				<tr>
					<s:iterator value="empList" var="user" status="st">
						<td><input type="checkbox" id="chks" value="<s:property value="#user.empId"/>"/>
							<span onclick="e(this);" value="<s:property value="#user.empName"/>"><s:property value="#user.empName"/></span>
						</td>
						<s:if test="#st.modulus(4) == 0">
							<s:if test="#st.last">
						</tr>
						</s:if><s:else>
							<tr></tr>
						</s:else>
						</s:if>
					</s:iterator>
			</table>
js 代码:
	function setIcpCode() {
		
		var chkValue ="";
		var chk=document.getElementsByTagName("input");
		for(var i=0;i<chk.length;i++){
			if(chk[i].checked){
				chkValue =chk[i].value;
			}
		}
   		window.opener.document.getElementById("callID").value=chkValue;
		window.close();
	}
	function e(s){
		var chkValue =s.value;
		window.opener.document.getElementById("caller").value=chkValue;
		setIcpCode();	
	}
我想让选中《span》时候checkbox 自动选中。。求解
------解决方案--------------------选中文字即为选中checkbox, 不需要一行代码的, 要的只是把span换成label就好。
此外, 来论坛, 最好把页面生成的html发出来, 这样我们更轻松点。
<html>
<head>
    <title>测试form</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js" type="text/javascript"></script>
    <style type="text/css">
        label{ cursor:pointer; }
    </style>
    <script type="text/javascript">
    </script>
</head>
<body>
    <div id="div1">
        <table width="500" border="1" cellspacing="1" >
            <tr>
                <th colspan="4" height="24">
                    业务员列表
                </th>
            </tr>
            <tr>
                <td>
                    <input type="checkbox" id="chks" value="1" />
                    <label for='chks' >1</label>
               &n