Can Chrome's last inspected elements be access with javascript?
Background, trying to integrate this into a Debug.js file to be called onclick. https://stackoverflow.com/a/12596540/511438
I am trying to integrate the function provided above to execute on a clickable element.
Here is my attempt which results in undefined even though i have inspected elements prior to executing this.
$(document).on('click', "#debugelements",
function () { CompareElements(window.$0, window.$1); });
and
function CompareElements(a, b)
{
... as per the answer above.
}
i suspect $0 is inaccessable to javascript. Is there a way to do this in javascript without pasting the whole function into the Chrome console?