我试图隐藏div并在keyup事件上显示另一个div。它不起作用我不知道为什么:
<div class = "beta_form">
<form id = "beta_form" class = "form-horizontal">
<label for="beta_password" class = "control-label">
</label>
<input id = "beta_password" name = "beta_password" type = "text" class = "form-control">
</form>
</div>
<div class = "facebook_twitter hidden">
<a class="btn btn-block btn-social btn-facebook">
<i class="fa fa-facebook"></i> Inicia sesión con Facebook
</a>
</div>
$("#beta_password").keyup(function(){
if ($(this).val() === '1789'){
$("#facebook_twitter").removeClass("hidden");
$("#beta_form").addClass("hidden");
}
});
提前感谢您的帮助。
答案 0 :(得分:3)
$("#facebook_twitter")
应该是
$(".facebook_twitter")