Posted By

Corhol on 09/04/06


Tagged

javascript style Switch


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Knarf


setStyleSheet() by Paul Sowdon


 / Published in: JavaScript
 

  1. // setStyleSheet() by Paul Sowdon
  2. // http://www.alistapart.com/articles/alternate/
  3. function setStyleSheet ( title ) {
  4. var i, a, main;
  5. for ( i = 0; ( a = document.getElementsByTagName("link")[i] ); i++ ) {
  6. if ( a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") ) {
  7. a.disabled = true;
  8. if ( a.getAttribute("title") == title ) a.disaled = false;
  9. }
  10. }
  11. }

Report this snippet  

You need to login to post a comment.