Beginner: where to declare jquery events' handler?
I'm starting with jQuery.
I have written the follonwing scripts in a web page:
<a href="http://jquery.com" id="jquery">JQuery</a>
<a id="weba" href="http://jquery.com">
<a id="compa" href="http://jquery.com">Ordinateur</a>
<script>
$(document).ready(function(){
$("a#jquery").click(function(event){
alert("Click JQuery OK");
event.preventDefault();
});
});
</script>
<script>
$(document).ready(function(){
$("a#weba").click(function(event)){
alert("Site web");
event.preventDefault();
});
});
</script>
<script>
$(document).ready(function(){
$("a#compa").click(function(event)){
alert("Ordinateur");
event.preventDefault();
});
});
</script>
I want the 3 links to have different behaviors with a "a#'id'" selector. But here only the first link give me a msgbox not the others.
What's wrong with my code?
Thanks.
Manu.