The most viewed posts

Registry Reviver

Contact Me

Web Development Services

Computer Repair and Maintenance Service

How to clean up Windows Computer

Driver Booster

Myanmar font and keyboard for Windows

About Desktop Icons in Windows Computer

CCleaner

How to make a computer secure and run faster

The most viewed items

Dell Inspiron 5559

SONY Playstation Portable

Desktop Hard Disk

Laptop RAM

HP ProBook 430

Laptop

External Hard Disk

Please login to start chat

ZilaStar ICT Sep 29 2021, 19:49:31
Category : JavaScript Tutorials

Adding Array Element (JS Arrays)

<!DOCTYPE html>
<html>
<head>
<title>JavaScript Code Testing</title>
</head>
<body>
<p id = "demo">forEach Loop</p>
<script>
var cities, text;
cities = ["Yangon", "Mandalay", "Naypyidaw", "Meikhtila"];

text = "<ul>";
cities.forEach(jsFunction);
text+= "</ul>";

function jsFunction(value){
text += "<li>" + value + "</li>";
}

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

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

  • Comments:

    No comment.

    To Contact
    Available Services
    Terms and Conditions