label对象如何使用htmlfor属性
的有关信息介绍如下:label对象htmlfor属性是
设置或返回 lable 的 for 属性的值,在label标签中添加的属性为for,但是在js中调用用htmlfor属性
创建一个名称为 label_htmlfor 的html文件
添加一个input元素 设置input类型为radio设置id为 my_lable_id_htmlFor_for,添加一个form表单,在表单中添加label设置for内容为my_lable_id_htmlFor_for,id 为my_lable_id_htmlFor
添加一个button按钮,在点击事件中加入自定义函数 为my_lable_htmlFor
添加一p标签,设置id 为 show_lable_htmlFor
在javascript中创建一个自定义函数 my_lable_htmlFor
在自定义函数中获取label对象。用 htmlfor属性获取 for属性中的属性值,将获取的结果添加到p标签中显示
在浏览器中打开文件 label_htmlfor ,点击button查看效果