I have a main page and in my head I have:
<script src="Script/jquery.min.js"></script>
<link href="Stylesheet/Master.css" rel="stylesheet" />
and I have a web form (named = Login.aspx) that was inherited from my main page, in Login.aspx I have:
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<input id="t1" type="password" placeholder="Passwords" class="login-input-class1" runat="server" ClientID="Static" />
<input id="t2" type="text" placeholder="ConfirmPasswords" class="login-input-class1" runat="server" ClientID="Static"/>
<label class="display" id="lblerror">Error</label>
<script>
$(document).ready(function () {
$("#t2").change(function () {
if ($("#t1").val() === $("#t2").val()) {
$("#lblerror").addClass("display");
}
else {
$("#lblerror").removeClass("display");
}
});
});
</script>
</asp:Content>
and in Master.css I have:
.display {
display:none;
}
But my script is not working, what is the problem?
source
share