| Author |
Confusing jquery code
|
David Mbura
Ranch Hand
Joined: Apr 06, 2010
Posts: 65
|
|
For some reason when i click book list element it shows both forms(books and classes) instead of just book form as if there is no break statement,i am really confused why is it doing that?
|
 |
Matthew Brown
Bartender
Joined: Apr 06, 2010
Posts: 3796
|
|
I just tried it out, and it seemed to work correctly (with including JQuery the only addition to the file). Are you sure that the code you posted is the code you're running?
From a stylistic point of view, I think it would be much better to add separate event handlers to the two elements, rather than adding the same event handler to each and then having to switch on the ID.
|
 |
David Mbura
Ranch Hand
Joined: Apr 06, 2010
Posts: 65
|
|
|
Thank you for the advice.And actually the code i was running is a little different,but i figured that couldn't be the cause ,I will go over it again and see what i get...
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56233
|
|
|
Always be sure to post a self-contained code example that you know shows the issue.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
 |
|
|
subject: Confusing jquery code
|
|
|