gaurih
asked on
How to access same jquery function on click of multiple elements
Hi,
My code snippet:
<a href="#" >edit</a>
<div class="entry">
...
<input type="button name="cancel">
</div>
Currently I have written the code to handle the current object and slidetoggle the div tag. but the same code is not working for onclick of cancel button because my code was like:
$(this).closest(div).sibli ngs(div.en try).slide toggle();
Can you give me some alternate solution to handle both scenarios
My code snippet:
<a href="#" >edit</a>
<div class="entry">
...
<input type="button name="cancel">
</div>
Currently I have written the code to handle the current object and slidetoggle the div tag. but the same code is not working for onclick of cancel button because my code was like:
$(this).closest(div).sibli
Can you give me some alternate solution to handle both scenarios
ASKER
The issue here is
$(this).closest(div).sibli ngs(div.en try).slide toggle(); is not getting triggered while I click the cancel button because it is part of the div.
Is there any solution to handle that?
$(this).closest(div).sibli
Is there any solution to handle that?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
so use :
Open in new window