Remove all other list items except the one that is clicked using jQuery
<p>I have list of this kind</p>

<pre><code>&lt;ul&gt;
&lt;li&gt;&lt;div class="pname"&gt;Name1&lt;/div&gt;&lt;div class="pid"&gt;ID1&lt;/div&gt;...&lt;/li&gt;
&lt;li&gt;&lt;div class="pname"&gt;Name2&lt;/div&gt;&lt;div class="pid"&gt;ID2&lt;/div&gt;...&lt;/li&gt;
&lt;li&gt;&lt;div class="pname"&gt;Name3&lt;/div&gt;&lt;div class="pid"&gt;ID3&lt;/div&gt;...&lt;/li&gt;
...
&lt;/ul&gt;
</code></pre>

<p>If I click on any of the list item, rest all other list items should be removed. Can anyone suggest how I could do this?</p>
