Monday, May 13, 2024
 Popular · Latest · Hot · Upcoming
162
rated 0 times [  169] [ 7]  / answers: 1 / hits: 52174  / 14 Years ago, thu, december 9, 2010, 12:00:00

I have a body element on which I add a few classes. And I want to remove the no-javascript class from it, after it's being read by the browser.



   <body class=foo boo no-javascript bla>
<script type=javascript>
// remove no-javascript class here
</script>

More From » html

 Answers
25

Well, since extra spaces between don't matter, I'd say:



document.body.className = document.body.className.replace(no-javascript,);


You can test it out here.


[#94667] Tuesday, December 7, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
dustin

Total Points: 599
Total Questions: 105
Total Answers: 106

Location: Belarus
Member since Tue, Mar 14, 2023
1 Year ago
dustin questions
;