I would like to compare the status of a variable "feedback" against a string 'Not Available'.
I'm able to console.log the value of the variable and it displays Not Available, yet, If statement logic is not displaying "username already in use"
var feedback = $("#feedback").text();
console.log("feedback status is:" + feedback);
if (feedback === 'Not Available') {
console.log("Username already in use!");
e.preventDefault();
};
e.preventDefault()is wrong. What supposed that does ? And can you please provide us with the exact output of theconsole.log?