I want compare two variables, that are strings, but I am getting an error.
=== is not necessary. You know both values are strings so you dont need to compare types.
function do_check()
{
var str1 = $("#textbox1").val();
var str2 = $("#textbox2").val();
if (str1 == str2)
{
$(":text").removeClass("incorrect");
alert("equal");
}
else
{
$(":text").addClass("incorrect");
alert("not equal");
}
}
.incorrect
{
background: #ff8888;
}