Return to Snippet

Revision: 23882
at February 16, 2010 07:51 by samuelcotterall


Updated Code
// HTML
<html class="no-js">…<html>

// JS
(function(H,C){H[C]=H[C].replace(/\bno-js\b/, 'js')})
(document.documentElement, 'className')

Revision: 23881
at February 16, 2010 07:50 by samuelcotterall


Initial Code
(function(H,C){H[C]=H[C].replace(/\bno-js\b/, 'js')})
(document.documentElement, 'className')

Initial URL


Initial Description
Detects JavaScript and switches class.

From an example given by [Paul Irish]('http://paulirish.com/perf/')

Initial Title
Detect JavaScript, switch class

Initial Tags


Initial Language
JavaScript