XHTML 1.0 valid + href target

“href target” is not XHTML 1.0 valid but very useful. With mootools adding the target-property afterwards is very easy:
window.addEvent('domready', function(){
  if ($$('a.external').length > 0) {
    $$('a.external').each(function(element, i) {
      element.setProperty('target', '_blank');
    });
  }
}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.