Aug
2

How to run jQuery in the Chrome dev console

08/02/2021 12:00 AM 经过 Admin Js


During front end developement we mostly use jQuery and so its good to know that how can we run jQuery queries from chrome or other chromium browsers developers console.

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

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();

After that you can execute jQuery queries directly in chrome dev console and test without writing your jQuery queries to html file and opening them in browser.


搜索
赞助
密码观察
跟着我们
赞助