Does anyone know how to select any element (possibly click) on the page, for example, select the body, select div, div # foo, etc., so I can put it in some kind of variable and edit it later.
I tried
$("*", document.body).click(function (e) {
e.stopPropagation();
var domEl = $(this).get(0);
alert("Clicked on - " + domEl.tagName);
});
but it does not work for all elements
source
share