setStyleSheet() by Paul Sowdon


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



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.