Unless a website your working on has already loaded jQuery, this tried and tested resource won't be available to you inside your console unless you can pull it in.
var jQueryScript = document.createElement('script'); jQueryScript.setAttribute('src','https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js'); document.head.appendChild(jQueryScript);
This does the trick. But you'll need to include this code each time you refresh the page.
Essentially, once you've created your custom bookmarklet, you can "Turn On" jQuery with a click and start writing out jQuery scripts to your hearts content in your console. No copying and pasting a block of code.
1. Create a new bookmark.
2. In the bookmark URL, enter:
3. Save your new bookmark.
Next time you need to use jQuery, click your new bookmark, open your console, and start writing jQuery.
You can replace "code.jquery.com/jquery-latest.min.js: with your own specific CDN URL if there's an older version of jQuery you prefer.