Created
January 17, 2016 23:04
-
-
Save evilnapsis/2870c3e3b194ba8ad75b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<body> | |
<script> | |
var body = document.body; | |
var h1 = document.createElement("h1"); | |
h1.innerHTML = "Prueba de listas"; | |
// lista no ordenada | |
var hul = document.createElement("h3"); | |
hul.innerHTML = "Lista no ordenada"; | |
var list1 = document.createElement("ul"); | |
for(i=0;i<10;i++){ | |
var li = document.createElement("li"); | |
li.innerHTML = "elemento #"+i; | |
list1.appendChild(li); | |
} | |
// lista ordenada | |
var hol = document.createElement("h3"); | |
hol.innerHTML = "Lista ordenada"; | |
var list2 = document.createElement("ol"); | |
for(i=0;i<10;i++){ | |
var li = document.createElement("li"); | |
li.innerHTML = "elemento #"+i; | |
list2.appendChild(li); | |
} | |
body.appendChild(h1); | |
body.appendChild(hul); | |
body.appendChild(list1); | |
body.appendChild(hol); | |
body.appendChild(list2); | |
</script> | |
</head> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment