We would like to know how to get htmlFor property for Label control.
<html>
<body>
<script language="JavaScript">
function function1() {<!-- w w w.j a v a 2 s .co m-->
console.log(document.all.myLabel.htmlFor);
}
</script>
<label id="myLabel" for="myButton"></label>
<button id="myButton" onclick="function1();">HTML for Label</button>
</body>
</html>
The code above is rendered as follows: