Reputation: 11523
Im trying to hide a div and show another on a keyup event. It doesn't work I don't know why:
<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");
}
});
Thanks in advance for your help.
Upvotes: 2
Views: 351
Reputation: 55750
$("#facebook_twitter")
is supposed to be
$(".facebook_twitter")
Upvotes: 3