Getting All Elements Using Mouse Down on Text
<p>I am trying to build WYSIWYG editor and facing a problem when the user mouses down on the HTML code:</p>

<pre><code>&lt;b&gt;&lt;i&gt;ABC&lt;/i&gt;&lt;/b&gt;
</code></pre>

<p>I want to select the <strong>B / Bold</strong> button and the <em>I / Italic button</em>, based on tags.</p>

<p>The result I want is that:</p>

<p>when the user mouses down on "ABC", the tags should return <code>b</code> and <code>i</code>.</p>

<p>Here is my code, but it is only working for one element, and I need a solution for multiple.</p>

<pre><code>var ev = arguments[0] || window.event,
origEl = ev.target || ev.srcElement;

alert(origEl.tagName);
</code></pre>
