Oct
6

How to run jQuery in the Chrome dev console

10/06/2023 01:23 AM by Admin in Js


During front end development we mostly use jQuery and so its good to know that how can we run jQuery queries from chrome or other chromium browsers or other browser which offer developer console like Mozilla Firefox, Microsoft Edge etc.

So first open your browser developer console from chromium browser settings or press CONTROL + SHIFT + I

Then execute the following queries in it.

var MyjQuery= document.createElement('script'); 
MyjQuery.src = "https://code.jquery.com/jquery-3.3.1.min.js";
document.getElementsByTagName('head')[0].appendChild(MyjQuery);
jQuery.noConflict(); // test it

OR in single line copy paste and execute in one go

var MyjQuery= document.createElement('script'); MyjQuery.src =  "https://code.jquery.com/jquery-3.3.1.min.js"; document.getElementsByTagName('head')[0].appendChild(MyjQuery);

after that you can execute jQuery's directly in console like

jQuery("#my_element").css("display", "block !important");

Your Thoughts

Search
SPONSOR
CRYPTOWATCH
FOLLOW US
ANNOUNCEMENTS

New tool added : SVG Zoom Dimension Calculator.

SPONSOR