javascript - Name Attribute of Clicked Element -
How do I get the elements clicked using Java Script
My code:
document.addEventListener ('click', function (e) {e = e || window.event; var elementname = e. ????; warning (elementname);}, false);
If you use jQuery, you can do this:
$ (document). Click (function (e) {warning ($ (e.target) .attr ('name'))});
Comments
Post a Comment