[jQuery] problem with chaining and building patterns
I am going over a tutorial on this site and trying to figure out whats
wrong with the syntax. The code I have is:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/
jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("a").filter("#clickme").click(function(){
alert("You are now leaving the site.");
});
.end()
$("a").filter("#hideme").click(function(){
$(this).hide();
return false;
});
.end();
</script>
</head>
<body>
<a href="http://google.com/" id="clickme">I give a message when you
leave</a>
<a href="http://yahoo.com/" id="hideme">Click me to hide!</a>
</body>
</html>
The tutorial orginally set it up to refer to the elments using class,
but I changed it to id and used the '#' in jquery to reference the
id's. Neither this nor the tutrials suggestion worked for me. Firebug
states there is a syntax error with the first
.end()
I have tried putting a semi colon thinking it should be ending a
statement but that didnt help.
Any thoughts?