change style when my script in head - Javascript jQuery

Javascript examples for jQuery:CSS

Description

change style when my script in head

Demo Code

ResultView the demo in separate window

<html>
   <head>
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>   
      <script>
    $(document).ready(function() {
        document.getElementById("p2").style.color = "blue";
    });/*w  w  w . j  a  v  a  2s .  c  om*/
  
      </script> 
   </head> 
   <body> 
      <p id="p2">Hello World!</p> 
      <p>The paragraph above was changed by a script.</p>  
   </body>
</html>

Related Tutorials