how i can use dynamic div id in click function of jQuery
<pre><code>&lt;div id="div1" style="display:none;" class="abcd"&gt;
     &lt;p&gt;Black&lt;/p&gt;
 &lt;/div&gt;
  &lt;div id="div2" style="display:none;"  class="abcd"&gt;
    &lt;p&gt;Red&lt;/p&gt;

 &lt;/div&gt;
  &lt;div id="div3" style="display:none;" class="abcd"&gt;
   &lt;p&gt;Blue&lt;/p&gt;
 &lt;/div&gt;

&lt;input type="button" value="Black" id="black" class="btn" 
onClick="showDiv('div1')"/&gt;

&lt;input type="button" value="Red" id="red" class="btn" 
onClick="showDiv('div2')"/&gt;

&lt;input type="button" value="Blue" id="blue" class="btn" 
onClick="showDiv('div3')"/&gt;

function showDiv(divId){

$('.abcd').hide();
$('#'+divId).show();

}
</code></pre>

<p>I am using the above code in javascript to show hide divs when corresponding button is     clicked and remaining divs need to hide.I am passing the div id from javascript function.</p>

<pre><code>$('#btn').click(function(){ 

});
</code></pre>

<p>Here how i can pass those divid dynamically in jQuery .click event.Thanks in advance....</p>
