I just curious about this.
I created an function that add ID value to a dynamically create li tag.
the function looks like this.
function limenu(lix,liy){
document.getElementsByTagName("li")[0].setAttribute("id",lix);
document.getElementsByTagName("li")[1].setAttribute("id",liy);
} limenu("icon-dice","icon-clock");
My thought is, can I use an for-loop? that let me insert how many events I want without need to create document.getElementsByTagName("li")[1]-[2]-[3].. etc
so when i call the function liemenu(), I would be able to add as many events i want.
I could use Jquery but i really want to do this with Javascript.
Thanks
http://jsfiddle.net/ExplosionPIlls/72hdS/