user1769203
user1769203

Reputation: 349

Don't see what's wrong with my javascript syntax?

I'm getting a syntax error saying there is an unexpected ")" -- just don't see it - anyone?

<script>
$(".signin_link_other").click(function() {
    $('#login_dropdown').clone().appendTo($(this)).toggle();
)};

$(".signup_link_other").click(function() {
    $('#signup_dropdown').clone().appendTo($(this)).toggle();
)};
</script>

Upvotes: 0

Views: 93

Answers (2)

pattyd
pattyd

Reputation: 6150

Change your code to this:

<script>
$(".signin_link_other").click(function() {
$('#login_dropdown').clone().appendTo($(this)).toggle();
});

$(".signup_link_other").click(function() {
$('#signup_dropdown').clone().appendTo($(this)).toggle();
});
</script>

All you had to do was change all of the )}; to });

Upvotes: 3

zs2020
zs2020

Reputation: 54504

$(".signin_link_other").click(function() {
    $('#login_dropdown').clone().appendTo($(this)).toggle();
)};

->

$(".signin_link_other").click(function() {
    $('#login_dropdown').clone().appendTo($(this)).toggle();
});

Change )}; to });

2nd one is similar.

Upvotes: 6

Related Questions