How to add event attribute to html tag with javascript
<p>I created some label tag with javascript something like this:</p>

<pre><code> var labelTag = document.createElement("label"); 
 labelTag.id = i; 
 labelTag.className ="myrows"; 
 labelTag.innerHTML = data[1];
</code></pre>

<p>It's ok, but i need to add onlick attribute to this label too.</p>

<p>So i need to look the result somthing like this:</p>

<pre><code>  &lt;label id='0' class='myrows' onclick=myfunction('first','second',..)&gt; some info here&lt;/label&gt;
</code></pre>

<p>I try with this:  <code>labelTag.onclick=myfunction('first',second,...);</code></p>

<p>No code error, but after i run the page on browser and see the source this attibute is missing.
 Whats wrong?</p>

<p>Thank you,</p>

<p>Holian</p>
