javascript - Jquery not working on the following code: -


this code in script.js:

$(document).ready(function() {     $('#mainobject').fadeout('slow'); }); 

and code in index.html:

    <!doctype html> <html> <head>          <title>hitler map</title>         <link rel="stylesheet" type="text/css" href="stylesheet.css"></link>         <script type="text/javascript" src="script.js"></script>     <script src="http://code.jquery.com/jquery-1.9.1.js"></script>  </head>  <body>     <div id="header">         <h1 id="title">         content         </h1>     </div>      <div id="footer">      </div>      <div id="mainobject">content1         <div id="aides">subcontent         <ul id="list1">             <li class="items">nananana batman</li>             <li class="items">woohoo</li>         </ul>         </div>          <div id="family">family         <ul id="list2">             <li class="items">spoder-man</li>             <li class="items">dolan</li>         </ul>         </div>         </div>    </body> </html> 

the stylesheet works fine, javascript working neither locally nor on server. please help? simple enough code.

you not including jquery

add following line inside head tag:

<script src="http://code.jquery.com/jquery-1.9.1.js"></script> 

also close ul tag

<ul> <li id="mainobject">some content</li> </ul> 

Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -