This is just a silly mistake I made which I thought I should share with the internetz. When assigning JQuery events to html elements, be sure to do it only after they have been loaded. If you just put them straight into a script file the elements wouldn't have loaded when it executes and hence the event won't work.
Make sure that all html DOM manipulation is done after the html loads by putting the javascript code inside a
$(document).ready(function() {
event and manipulation stuff here :D
});
You can leave jQuery out of this and make it more generic since it applies to all DOM manipulation activities:
ReplyDeletewindow.onload = function () {
element.onlick = ...
};