Javascript for-in Statement on DOM Nodes

Description

Javascript for-in Statement on DOM Nodes

View in separate window


<html>
<body>
<a href="www.cnn.com" id="hreflink">Hello</a><br />
<script>

let myLink = document.getElementById("hreflink");
for (info in myLink) {/*from   ww w  .j a  v a2s. co m*/
  console.log(info + "-" + myLink[info] );
}
</script>
</body>
</html>



PreviousNext

Related