I'm trying to change the innerHTML
of each div
. I'm not seeing the code work as intended. Can anybody help me understand why the changes are not occurring?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<div style="background: #FFEE05">f</div>
<div style="background:#2B9423 ">d</div>
<div style="background: #0024FF">s</div>
<div style="background: #EF2E31">e</div>
<script>
var dvs=document.getElementsByTagName("div")
dvs.innerHTML="<a href='#'>click here</a>"
</script>
</body>
</html>