Add / remove class after certain amount of seconds - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:removeClass

Description

Add / remove class after certain amount of seconds

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-3.1.1.js"></script> 
  <style id="compiled-css" type="text/css">

.blue{/* ww  w .  j  a  va 2  s.c  o m*/
   color: blue;
}


      </style> 
  <script type="text/javascript">
    window.onload=function(){
setTimeout(function(){
$("div").removeClass("blue");
}, 2000);
    }

      </script> 
 </head> 
 <body> 
  <div class="blue">
    jdkjfhdsk 
  </div>  
 </body>
</html>

Related Tutorials