SO fiddle

Test Fiddle mainly for SO Questions

by Nick Craver

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/themes/overcast/jquery-ui.css">
<h2>Test</h2>
<h2>Test Longer</h2>
<h2>Test</h2>
<h2>Test Even Longer!</h2>
<h2>Test</h2>

CSS

.widest { color: red; }

JavaScript

var cw = 0, widest;
$("h2").text(function(i, t) { if(t.length > cw) {widest = this; cw = t.length;} return t; });
$(widest).addClass("widest");