<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8"/>
<title>Mobile-Web-App: Create HTML List using Javascript</title>
<script >
function myOnLoad(){
var div_info = document.getElementById("info");
var new_ul = document.createElement("ul");
new_ul.appendChild(create_li("Sunday"));
new_ul.appendChild(create_li("Monday"));
new_ul.appendChild(create_li("Tuesday"));
new_ul.appendChild(create_li("Wednesday"));
new_ul.appendChild(create_li("Thursday"));
new_ul.appendChild(create_li("Friday"));
new_ul.appendChild(create_li("Saturday"));
div_info.appendChild(new_ul);
}
function create_li(item){
var new_li = document.createElement("li");
new_li.innerHTML = item;
return new_li;
}
window.onload = myOnLoad;
</script>
</head>
<body>
<H1>Mobile-Web-App: Create HTML List using Javascript</H1>
<div id="info">
</div>
</body>
</html>
Related:
- Create HTML List using jQuery

No comments:
Post a Comment