I want to compare the data of two text boxes using jquery like as we compare the password and confirm password while making an email account. Still i have the following stuff.
CSS
.test {
display:none;
}
HTML
<input type="text" name="t1" />
<input type="text" name="t2" />
<label class="test" name="lblerror">Error</label>
jQuery
$("#t2").click(function () {
if ($("#t1").val() === $("#t2").val()) {} else {
$("#lblerror").removeClass("test");
}
});
Please help me, how can i compare these two strings while just leaving the second text box named t2.
Thanks in advance.