Each time a button is clicked i'm entering a function where I check if a listitem with specific classname exists. If it exists, then it has to be removed.
if($("ul#" + this.listClass + " li[class='errorlist']"))
{
console.log("error");
}
Now, it enters the function each time I click, even if it doesn't exist.
Thanks in advance.