toStandard //JavaScript Function
example:
1 2 s = '<INPUT type=text value="a b c" readonly x="123">blabla<DIV></DIV>'; 3 prompt("", toStandard(s));
code:
1 2 //+ Jonas Raoni Soares Silva 3 //@ http://jsfromhell.com 4 5 function toStandard(s){ 6 return s.replace(/<(\/?\w+)([^>]*)>/g, function(s, t, c, d){ 7 return "<" + t.toLowerCase() + c.replace(/\b(\w+)(?:=((?:(?=(["'])).((?!\3)(?:.|\n))*\3)|\S*))?/g, function(s, p, v, a){ 8 return (p = p.toLowerCase()) + "=" + (a = a ? "" : '"') + (v || p) + a; 9 }) + ">"; 10 }); 11 };