How to get the clicked elements' id and open a popup in jquery
<p>I have some <code>&lt;div&gt;</code> tags created by Javascript each having different "id" and "class" attribute.</p>

<p>Some samples of div tags  </p>

<pre><code>&lt;div id="demoid1" onclick="javascript:openDialog(this)" class="demoClass1"&gt;demoTag1&lt;/div&gt;
&lt;div id="demoid2" onclick="javascript:openDialog(this)" class="demoClass2"&gt;demoTag2&lt;/div&gt;
&lt;div id="dialog-1" title="Test Case Details"&gt;
    &lt;P&gt;This my first jQuery UI Dialog!&lt;/P&gt;
&lt;/div&gt;
</code></pre>

<p>Code done so far: </p>

<pre><code>function openDialog(ev) {
var docid= ev.id;
 $(function () {
    $("#dialog-1").dialog({
        autoOpen: false,
    });
    $("#"+docid).click(function () {
        $("#dialog-1").dialog("open");
    });
});
}
</code></pre>

<p>Please help.
Update:
I have such 10-15 <code>&lt;div&gt;</code> tags and each one different ID.</p>

<p>I want those <code>&lt;div&gt;</code> tags to be clickable and on click it will pop up a small display window.</p>

<p>Before I needed the ID of the element clicked so that I can fetch information dynamically from JSON so that I can display the information. </p>