Posted By

vagrantradio on 07/13/10


Tagged

css replace jquery find abbr annoying acronym


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

jackkeller
wirenaught


Find and Replace


 / Published in: jQuery
 

Finds word "AGM" and replace with acronym or abbr title.

  1. //Cross-browser CSS
  2. abbr, acronym, .help {
  3. border-bottom-style:dotted;
  4. border-bottom-width:1px;
  5. border-bottom-color:#000;
  6. cursor:help;
  7. display:inline-block;
  8. }
  9.  
  10. //acronym
  11. jQuery("p.att").each(function() {
  12. jQuery(this).html(jQuery(this).html().replace('AGM', '<acronym title="Absorbed Glass Mat">AGM</acronym>'));
  13. });
  14.  
  15. //abbreviation
  16. jQuery("p.att").each(function() {
  17. jQuery(this).html(jQuery(this).html().replace('AGM', '<abbr title="Absorbed Glass Mat">AGM</abbr>'));
  18. });
  19.  
  20. //help class
  21. jQuery("p.att").each(function() {
  22. jQuery(this).html(jQuery(this).html().replace('AGM', '<span class="help" title="Absorbed Glass Mat">AGM</span>'));
  23. });

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: vagrantradio on July 30, 2010

Really, comment spam? wtf?

You need to login to post a comment.