Posted By

samuelcotterall on 02/16/10


Tagged

detection


Versions (?)

Detect JavaScript, switch class


 / Published in: JavaScript
 

Detects JavaScript and switches class.

From an example given by Paul Irish

  1. // HTML
  2. <html class="no-js"><html>
  3.  
  4. // JS
  5. (function(H,C){H[C]=H[C].replace(/\bno-js\b/, 'js')})
  6. (document.documentElement, 'className')

Report this snippet  

You need to login to post a comment.