NOTE: All these utility things only work on dev tools console. They will not work in scripts.
The page used is https://example.com
You can use
$_ to get the last evaluated value.
You can use these to reference recently accessed elements in the console. You can access elements using the "Elements" tab.
$0 returns the most recently accessed element,
$1 returns the second most recently accessed variable, the rest of these works in the same way.
- Accessing an element
- Referencing the element in the console
You can use these utility functions to find an element in the document.
$() is basically an alias for
$$() is for
For both of these function, the first parameter is the selector you want to find, i.e. -
$('.sel') basically means
There is also an optional second parameter, this should be a
Element in which the selector should be searched. Like before,
$('.sel', element) basically means
$$('.sels', element) means
You can use this utility function to copy the string representation of any object to the clipboard.
keys() is just an alias for the
Object.keys method and
values() is alias for the
Saving a logged object in the console
Multiline text with
Enter key combination
That's all for now. See you next time!
Top comments (0)