Posted By

AzizLight on 11/27/09


Tagged

javascript jquery


Versions (?)

Dynamically add an icon for external links


 / Published in: jQuery
 

URL: http://www.learningjquery.com/2008/08/quick-tip-dynamically-add-an-icon-for-external-links

  1. #
  2. $(document).ready(function() {
  3. #
  4. $('#extlinks a').filter(function() {
  5. #
  6. return this.hostname && this.hostname !== location.hostname;
  7. #
  8. }).after(' <img src="/images/external.png" alt="external link"/>');
  9. #
  10. });

Report this snippet  

You need to login to post a comment.