Created
April 15, 2021 21:56
-
-
Save rvizena/a5b49e3f0a96030bcce76cba89f62b2d to your computer and use it in GitHub Desktop.
Debugging: Find elements wider than the body w/ JS
This file contains hidden or 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
//place this code into the browser's console | |
var docWidth = document.documentElement.offsetWidth; | |
[].forEach.call( | |
document.querySelectorAll('*'), | |
function(el) { | |
if (el.offsetWidth > docWidth) { | |
console.log(el); | |
} | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment