html - Jquery doesn't link, why? -


<!doctype html> <html>     <head>         <link rel="stylesheet" type="text/css" href="stylesheet.css"/>         <script type="text/javascript" src="script.js"></script>     </head>     <body>         <div id="red"></div>         <div id="blue"></div>         <div id="yellow"></div>         <div id="green"></div>     </body> </html> 

script.js

$(document).ready(function() {    $('div').mouseenter(function() {        $(this).animate({            height: '+=10px'        });    });    $('div').mouseleave(function() {        $(this).animate({            height: '-=10px'        });     });    $('div').click(function() {        $(this).toggle(1000);    });  }); 

add jquery framework html head tag, before own js use jquery:

<head>     <link rel="stylesheet" type="text/css" href="stylesheet.css"/>     <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>     <script type="text/javascript" src="script.js"></script> </head> 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -