Overriding !important style with jquery - Javascript jQuery

Javascript examples for jQuery:CSS

Description

Overriding !important style with jquery

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-1.11.0.js"></script> 
  <style id="compiled-css" type="text/css">

div{/*from w  w  w .j  ava 2 s.  co m*/
   background:red;
   width:10px;
   height:10px;
   display:none !important;
}


      </style> 
  <script type="text/javascript">
    $(window).load(function(){
$(function(){
    $("div").attr("style", "display:block !important");
});
    });

      </script> 
 </head> 
 <body> 
  <div></div>  
 </body>
</html>

Related Tutorials