Selecting problems else if

Selecting problems else if

Hi,

i'm relative new to jQuery and for me the hardest part 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
  1. <div id="results"><p></p></div>

if theres an error
  1. <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
  1. if ($("div#results p.error").length) {
  2.    $('#hint').hide();
  3. }
But how to check for #results without p class="error"?

  1. if ($("div#results p.error").length) {
  2.    $('#hint').hide();
  3. }
  4. else if {
  5. $("div#results but p not class error").length) {
  6.    $('#hint, form').hide();
  7. }