Skip to content

Instantly share code, notes, and snippets.

@nielsenrc
nielsenrc / widest-element-on-page.js
Created September 9, 2015 19:37
JS | Find Widest Element on Page with Javascript
var widest = null;
// remember the width of the "widest" element - probably faster than calling .width()
var widestWidth = 0;
$("div").each(function() {
if (widest == null)
{
widest = $(this);
widestWidth = $(this).width();
}
else