Remove text from a node (e.g in links)


/ Published in: jQuery
Save to your folder(s)

Removed a certain word from a list of links (purely for design reasons). Link length way to long with the link included.


Copy this code and paste it in your HTML
  1. /**
  2. * Remove some text dynamically from the Nav (for design)
  3. */
  4. $("ul#aPorts li a").not(":last").each(function(){
  5. var alteredString = $(this).text().replace(/Airport/,"");
  6. $(this).text(alteredString);
  7. });

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.