Please login to start chat

ICT Solutions 22 Jun 2022, 09:39:01
Category : JavaScript Tutorials

for (JS For Loop)

<!DOCTYPE html>
<html>
<head>
<title>JavaScript Code Testing</title>
</head>
<body>
<p id = "demo"></p>
<script>
var names = ["Maung Maung", "Aung Aung", "Mya Mya", "Hla Hla"];
var i, txt;

txt = "<ol>";
for(i=0; i<names.length; i++){
txt += "<li>" + names[i] + "</li>";
}
txt += "</ol>";

document.getElementById("demo").innerHTML = txt;

</script>
</body>
</html>

Comments:

No comment to show.

Available Services
Download Android Application