/ Published in: jQuery

Finds word "AGM" and replace with acronym or abbr title.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//Cross-browser CSS abbr, acronym, .help { border-bottom-style:dotted; border-bottom-width:1px; border-bottom-color:#000; cursor:help; display:inline-block; } //acronym jQuery("p.att").each(function() { jQuery(this).html(jQuery(this).html().replace('AGM', '<acronym title="Absorbed Glass Mat">AGM</acronym>')); }); //abbreviation jQuery("p.att").each(function() { jQuery(this).html(jQuery(this).html().replace('AGM', '<abbr title="Absorbed Glass Mat">AGM</abbr>')); }); //help class jQuery("p.att").each(function() { jQuery(this).html(jQuery(this).html().replace('AGM', '<span class="help" title="Absorbed Glass Mat">AGM</span>')); });
Comments
