您的位置:首页 > 其它

点击文字可以选中相应的checkbox

2014-02-19 10:25 155 查看
<html>

<head>

<title>点击文字选中的复选框</title>

<meta http-equiv="content-Type" content="text/html;charset=gb2312">

</head>

<body>

<!--把下面代码加到<body>与</body>之间-->

<form>

<label for="check1">姓名</label>

<input type="checkbox" id="check1" value="123" name="name">

<label for="check2">密码</label>

<input type="checkbox" id="check2" value="456" name="name">

</form>

</body>

</html>

注意事项:文字必须是label标签内,checkbox的id和<label>标签内的for=""中的名字必须相同.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: