黑马程序员技术交流社区

标题: lable标签指向的问题。 [打印本页]

作者: 郑玉赛    时间: 2012-5-17 21:44
标题: lable标签指向的问题。
本帖最后由 郑玉赛 于 2012-5-17 22:04 编辑

看视频说lable for “”  ,在引号里填入另外个控件的ID,列如checkbox的ID,然后运行网页的时候,如果点击了lable,checkbox就会显示出被选中的状态。但是我运行起来,好像选不了,大家帮我看看
<table border="1">
      <tr><td><Lable for "username">姓名:</Lable></td><td><input type="text" id="username"/></td></tr>
      <tr><td><lable for "password">密码:</Lable></td><td><input type="password" id="password"/></td></tr>
      <tr><td><lable for "yanzhenma">验证码:</Lable></td><td><input type="text" " id="yanzhengma"/><img alt="验证码" src="Scripts/QQ截图2012051721142.png"/></td></tr>
      <tr><td><lable for "rember">记住密码</lable><input type="checkbox" id="rember"/></td><td><input type="submit" value="登录"/></td></tr>
</table>   
请无视拼音。
作者: 王卫    时间: 2012-5-17 21:55
标签 你 拼写 错误 ---- 是 <label>------ok-------
作者: 王卫    时间: 2012-5-17 21:59
还有 就是  for 后面 需要 =  -------
作者: 郑玉赛    时间: 2012-5-17 22:04
{:soso_e140:}沉吧沉吧,丢死人了。
作者: 余宏    时间: 2012-5-17 22:05
<!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>无标题文档</title>
</head>

<body>
<table border="1">
       <tr><td><Lable for "username">姓名:</Lable></td><td><input type="text" id="username"/></td></tr>
       <tr><td><lable for "password">密码:</Lable></td><td><input type="password" id="password"/></td></tr>
       <tr><td><lable for "yanzhenma">验证码:</Lable></td><td><input type="text" " id="yanzhengma"/><img alt="验证码" src="Scripts/QQ截图2012051721142.png"/></td></tr>
       <tr><td><lable for "rember">记住密码</lable><input type="checkbox" id="rember"/></td><td><input type="submit" value="登录"/></td></tr>
</table>   

</body>
</html>
我这里能选中,你再试试看。




欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2