jQuery Style How to - Remove class from body tag








Question

We would like to know how to remove class from body tag.

Answer


<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-1.7.1.js'></script>
<script type='text/javascript'>//<![CDATA[ 
$(window).load(function(){<!-- w w  w  .  j  a v a 2 s  .com-->
    $("body").removeClass("page");
});//]]>  
</script>
</head>
<body class="page otherattr">
</body>
</html>

The code above is rendered as follows: