I need to make the event of the window to be triggered first, on clicking on the #myDiv, is there a way to do it?
(function ($, w, d) {
$(d).ready(function () {
$(w).click(function() {
alert('window has been clicked');
});
$('#myDiv').click(function () {
alert('myDiv has been clicked');
});
});
})(jQuery, window, document);
check this out http://jsfiddle.net/au1hpj5L/