Selecting problems & else if - Glasspoole wants to be a Ninja - Part1

Hi,

the jQuery Ninja book is great, but i have some problems. I hope i get help here at getting my problems solved. So i start one thread for every problem, cause for me getting the problems solved here with hepl is the best way to lern it.

The hardest part for me is allways to get the right elements.

Ok, i have a form and in this form i have a lable (id=“hint”).
After sending the form above the form a div shows up.
If everything is ok the div looks like that:

<div id=“results”><p></p></div>

if theres an error

<div id="results"><p class="error"></p></div>

I want to hide the <lable id=“hint”> and the form if there is <div id=“results”><p>
If there is <div id=“results”><p class=“error”> i just want to hide the <lable id=“hint”>

This works if theres an error and hides the hint

if ($("div#results p.error").length) {
  $('#hint').hide();
}

But how to check for #results without p class=“error”?

if ($("div#results p.error").length) {
  $('#hint').hide();
} else if {
$("div#results but p not class error").length) {
  $('#hint, form').hide();
}

No edit button here?

Ok, same probleme here.

$(document).ready(function() {
 $('nav#menu a')
  .hover(function() {
   $(this).stop().animate({ left: 5 }, 'fast');
  }, function() {
   $(this).stop().animate({ left: 0 }, 'fast');
  });
});

but how to exclude the “a” that is in a “li” with class active?

Edit:
oh the edit button has a time limit.

Ok, i got this one:

$('nav#menu ul li a:not(ul li.active a)')