Created
November 12, 2014 17:33
-
-
Save thornbill/2c66b2b35a70b3438620 to your computer and use it in GitHub Desktop.
Bookmarklet that highlights any table elements on a page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(d){function h(e){if(typeof e!=='object')return;function o(e){var _x=0,_y=0;while(e&&!isNaN(e.offsetLeft)&&!isNaN(e.offsetTop)){_x+=e.offsetLeft;_y+=e.offsetTop;e=e.offsetParent;}return {top:_y,left:_x};}var p=o(e);c(p.left,p.top,e.clientWidth,e.clientHeight);}function c(x,y,w,h){var e=d.createElement('div');e.style.zIndex='999999';e.style.background='rgba(255,0,0,0.6)';e.style.position='absolute';e.style.left=x+'px';e.style.top=y+'px';e.style.width=w+'px';e.style.height=h+'px';d.body.appendChild(e);}var t=d.getElementsByTagName('table'),i,l=t.length;for(i=0;i<l;i++){h(t[i]);console.log(t[i]);}})(document); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nice