I have created an element using document.getElementsByClassname, and would like to add a onclick event to this element, so that when someone clicks on this element onclick f
I was able to add an onclick event to an element using following javascript code
list_title = document.createElement('UL'); list_title.onclick=function() { // place your code here };