Menu
Hi All,
I am trying to pass the dynamic div id to the jquery onclick function.
Here is the html code
[code=html]<div id = “show1″ class=”test”>Click 1</div>
<div id = “show2″ class=”test”>Click 2</div>
[CODE]<script>
$(document).ready(function(){
$(“.test”).click(function(){
$(“#show1”).slideToggle(“slow”);
});
</script>
So it works for the first div not for the second one.There is something called “closest” id selector in jquery but not sure.
Please suggest me….Thanks in advance.
Raj