javascript attached click event issue
<p>I am trying to setup a <code>click</code> event to a <code>&lt;a&gt;</code> tag inside a <code>TD</code></p>

<p>I have</p>

<pre><code>test.prototype.buildData = function() {
 cell = createElement('td', {innerHTML: "&lt;a class='link' onclick='"+this.edit(this)+"'&gt;"+ value + "&lt;/a&gt;"});
 this.table.appendChild(cell);

 //many cells..all need to attached the click event

}

test.prototype.edit=function(this){
  this.style.backgroundColor='red'  
}
</code></pre>

<p>I want to modify the clicked <code>cell</code> <code>background color</code>. I also need to register <code>click</code> event ONLY to the <code>&lt;a&gt;</code> tag. I know my <code>this.edit(this)</code> doesn't make sense.</p>

<p>Are there anyways to do this? Thanks a lot!</p>
