jquery - External javascript not working -


i have placed 1 javascript (hide.js) in html page ... hide function not working .
my scripts in right order
code per tutorial

<!doctype html > <html lang="en"> <head>     <meta charset="utf-8" />     <title>jquery example </title> </head> <body>     <p id="paragraph ">         paragraph</p>     <script type="text/javascript" src="http://localhost/webapplication2/js/hide.js"></script>     <script type="text/javascript" src="http://localhost/webapplication2/js/jquery-1.7.1.min.js"></script>     <script type="text/javascript" src="http://localhost/webapplication2/js/toggle.js"></script> </body> </html> 

hide.js

$('#paragraph').click(function () {     $('#paragraph').hide(); }); 

i have test firebug lite on chrome .. console doesnt show error .. in script showing external scripts ...other script working fine
have rearranged script order

<script type="text/javascript" src="http://localhost/webapplication2/js/jquery-1.7.1.min.js"></script> <script type="text/javascript" src="http://localhost/webapplication2/js/toggle.js"></script> <script type="text/javascript" src="http://localhost/webapplication2/js/hide.js"></script> 

still not working .. couldnt find relevant link ..whats wrong ..please suggest

you have space in id of paragraph tag, invalid, javascript cannot select paragraph using id.

you need remove space id attribute.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -