Juicy
Juicy

Reputation: 12530

Toggle not working on an element

I'm using

$("#termsLink").click(function(){
    $("termsWrap").toggle();
    alert();
});

to try and toggle an element that is set to display: none; by default. The alert() is triggered but the display doesn't set to block. I can't figure out what is going wrong.

Upvotes: 0

Views: 46

Answers (2)

JTG
JTG

Reputation: 8836

Should be $("#termsWrap").toggle(); not $("termsWrap").toggle();

Upvotes: 4

Kenny Thompson
Kenny Thompson

Reputation: 1492

Looks like you forgot the # hashtag before termsWrap

Upvotes: 3

Related Questions