Reputation: 10228
I need to attach jQuery to a web page which is completely loaded. For example, I want to attach jQuery to this current page (stackoverflow) and then use it.
Well I did it:
But I don't see any reaction of the code I've written. I mean that alert
won't be shown when I click on the document.
Anyway, is it possible to I attach a library like jQuery to a loaded page and writing some JS codes in it?
Upvotes: 1
Views: 47
Reputation: 1038930
If you are just trying to add some onclick handler to the document using your browser, then simply open the console and type the following:
document.onclick = function() { alert("document clicked"); };
Then go clicking around:
Upvotes: 2