click function for retrieving div
<p>how can i retrieve find out which button click is from which div.
Basically i have multiple div</p>

<pre><code>&lt;div id="rare1"&gt;
&lt;input type=button value="OK" id=btn&gt;
&lt;/div&gt;
&lt;div id="rare2"&gt;
&lt;input type=button value="OK" id=btn&gt;
&lt;/div&gt;
&lt;div id="rare3"&gt;
&lt;input type=button value="OK" id=btn&gt;
&lt;/div&gt;
</code></pre>

<p>i have a function</p>

<pre><code>$("#btn").click(function(){
    $("#rare"+i+" #btn").attr("disabled", "true");
}
</code></pre>

<p>this way i can disable the latest button being added.
how can i select which ever button is click on different div id and select the correct btn to disable?</p>

<p><strong>so sorry forget to add something i want to retrieve the div id that clicked the button too.</strong> </p>
