M
Michael Hill
I had this html:
<tr id="action" title="click to do something" onclick="alert('mike');">
<td>a</td>
<td>b</td>
</tr>
and it works when I click on the row, but when I try to add it
dynamically like:
myTR=document.createElement("TR");
myTR.id="action";
myTR.title="click to do something";
myTR.onclick="alert('mike');";
myTD=document.createElement("TD");
myText=document.createTextNode("a");
myTD.appendChild(myText);
myTD=document.createElement("TD");
myText=document.createTextNode("b");
myTD.appendChild(myText);
myTR.appendChild(myTD);
myTABLE.appendChild(myTR);
Nothing is happening when I click on the row. I know some of the
attribute are case sensitive. I tried onclick, onClick, OnClick, none of
them work.
Anyone know what's up?
Mike
<tr id="action" title="click to do something" onclick="alert('mike');">
<td>a</td>
<td>b</td>
</tr>
and it works when I click on the row, but when I try to add it
dynamically like:
myTR=document.createElement("TR");
myTR.id="action";
myTR.title="click to do something";
myTR.onclick="alert('mike');";
myTD=document.createElement("TD");
myText=document.createTextNode("a");
myTD.appendChild(myText);
myTD=document.createElement("TD");
myText=document.createTextNode("b");
myTD.appendChild(myText);
myTR.appendChild(myTD);
myTABLE.appendChild(myTR);
Nothing is happening when I click on the row. I know some of the
attribute are case sensitive. I tried onclick, onClick, OnClick, none of
them work.
Anyone know what's up?
Mike