Welcome aboard! We are happy you are here and wish you good net-raft!
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div class="myClass"></div></br>
<div class="myClass"></div></br>
<div class="myClass"></div></br>
<script type="text/javascript">
function changeObject() {
var o = document.getElementsByClassName("myClass");
for (var i = 0; i < o.length; ++i) {
o[i].innerHTML = "div" + [i];
}
}
</script>
<button type="button" onclick="changeObject()">click</button>
</body>
</html>
The most helpful JAVASCRIPT solutions
How can I get the last day and the next day in javascript ?JAVASCRIPT Click to see more ... 5.9K 508