Add onclick event to newly added element in JavaScript
.onclick
should be set to a function instead of a string. Try
elemm.onclick = function() { alert('blah'); };
instead.
You can also set attribute:
elem.setAttribute("onclick","alert('blah');");
Not sure but try :
elemm.addEventListener('click', function(){ alert('blah');}, false);