how to add onclick to child element created javascript

JavaScript
elemm.onclick = function() { alert('blah'); };
Source

Also in JavaScript: