You need to wrap your script in a ready block.

$(document).ready(function(){
//your stuff here
});

The reason is that the <a> links dont exist yet when your run your script.
Browsers run scripts the second they see them and dont wait for the rest of
the page to load.  The ready block makes the script wait until the page
shows up before running.

Other helpful things:
*Where to start:* http://docs.jquery.com/Main_Page
*Plugins:* http://jquery.com/plugins/
*Tutorial Blog: *
http://www.learningjQuery.com<http://www.learningjquery.com/>(also a
book)
*Some basic samples:* http://www.commadot.com/jquery

Glen


On Nov 20, 2007 9:25 AM, iPhenom <[EMAIL PROTECTED]> wrote:

>
> Respected Seniors
>
> i just came across jQuery on my way searching for something else n
> decided to learn coding with jQuery.
> Here is my very first piece of code with jQuery but I cant get it to
> work:
>
> <html>
> <head>
>
> <title>tut1</title>
> <script type="text/javascript" src="jquery.js"></script>
> <script type="text/javascript">
> $("a").click(function(){
>   $(this).hide("slow");
>   return false;
>  });
>
> </script>
> </head>
>
> <body>
> Click <a href="http://www.yahoo.com";>here</a>
> </body>
> </html>
>
> the jquery.js file is in same folder as this html file. there is no
> other file in the folder. I m using IE7.
> Please Help. waiting to get started.
>
> Regards
> iPhenom
>

Reply via email to