[jQuery] Do tabulations and spaces make a difference?
Hi!
I just downloaded jquery today and the first thing I did was to start
learning from this tutorial: http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery
, but I am having trouble with this part:
http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery#Find_me:_Using_selectors_and_events
In that part, there is this code:
$(document).ready(function() {
$("#orderedlist li:last").hover(function() {
$(this).addClass("green");
},function(){
$(this).removeClass("green");
});
});
That works just fine, but when I try to type it myself so it looks
like this:
$(document).ready(function() {
$("#orderedlist li:last").hover(function() {
$(this).addClass("green");
},function() {
$(this).removeClass("green");
});
}):
It doesn't work. I have checked it thoroughly for misspelled words,
but I don't see any difference between them. Can you spot the problem?
I won't see examples all the time, so copy & paste only works in
tutorials. I have to learn the syntax right.
Are the spaces in there causing the problem?
Thank you for your help.