how to add onclick to child element created javascript code example Example: how to add onclick to child element created javascript elemm.onclick = function() { alert('blah'); };