What am i doing wrong?

function error_msg(code)
{
  if (code=="pass")
  {
      alert(code); //pops/works
      $('#error').addClass("notification fail").fadeIn();  //does nothing
      $('#error').html('<strong>Incorrect Password</strong><span style="color:black"> - Please try again.</span>');//does nothing
  }	
}

Any help will be appriciated :-)

Recommended Answers

Yes, this should work. Do you have it live somewhere, where does it not work, are you sure there is an #error?

Jump to Post

All 3 Replies

Yes, this should work. Do you have it live somewhere, where does it not work, are you sure there is an #error?

Is your JavaScript function wrapped in:

$(function() {
    // code goes here...
});

or

(function() {
    // code goes here...
})();

Use firebug to see what happen.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.