Im pretty frustrated with this, as I feel like I am missing something really simple but just cant figure it out. Basically I was going to use jQuery to animate the "search" image at the top. After this didnt work, I realized I couldnt get any jquery to work
So I went back to basics to try a very simple script and just cant get any jQuery to work.
Code:
Code:
$(document).ready(function(){
("a#searchAnimate").click(function(event){
alert("As you can see, the link no longer took you to jquery.com");
event.preventDefault();
});
});
If you view the page, you can see the scripts are being called properly in the head and appear inf firebug, I thought it might have been a path issue, so threw in the absolute path and still couldnt get it to work.
So, any ideas what have I done wrong? Appreciate any help or advice
Best Regards,
Drew
Edit-Just would like to add before someone tells me to correct them, the 4 html markup errors are just from the free host that I use tracking script, the actual page and markup is valid
$(document).ready(function(){
$("a#searchAnimate").click(function(event){
alert("As you can see, the link no longer took you to jquery.com");
event.preventDefault();
});
});
Also, sincce id is unique in every page, you can just remove highlighted:
Wow, I feel pretty embarrassed that I missed that. Thank you very much. However, I still cannot jQuery to function as I want it to. Take for example this:
Click on the image and it hides, nothing wrong (as far as I can see), or you expect it to do something else?
Nope, that works great. It was really strange, I got it to work if I put the script hard coded on the html instead of linking to it. I then tried linking to it again and it worked
Either way, im satisfied, thanks very much for all of your help Rangana