Can someone tell me why this code is not hiding elements dynamically added to the html
document:
$("p , h1 , h2").mousedown(function(){
$(this).hide();
});
This selection works only with the existing element in the html page, but doesn't work with what I add with after method on the fly.
It seems that any new p
element or h1
element that get added in the fly doesn't get any recognition from this selector.