Reputation: 3
Where is the error in writing this post?
<script>
$(function(){
$("#teacher").clik(function({
$("#login_teachers").slideToggle();
$("#login_teachers").css('display', 'block');
$("#login_parents, #login_students").css('display', 'none'),
});
$("#parents").clik(function({
$("#login_parents").slideToggle();
$("#login_parents").css('display', 'block');
$("#login_teachers, #login_students").css('display', 'none'),
});
$("#students").clik(function(){
$("#login_students").slideToggle();
$("#login_students").css('display', 'block');
$("#login_parents, #login_teachers").css('display', 'none');
});
});
</script>
I'm getting the error
Uncaught SyntaxError: Unexpected token '}'
Upvotes: 0
Views: 1386
Reputation: 7490
There are two different errors (each repeated three times):
click
event handlers definition: your code wrongly contains clik
, instead.$("#login_teachers, #login_students").css('display', 'none'),
is terminated by a comma instead of a semicolon.The "Unexpected token '}'" error is due to the second mistake.
Upvotes: 1