faqts : Computers : Programming : Languages : JavaScript : DHTML : DOM

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

12 of 26 people (46%) answered Yes
Recently 5 of 10 people (50%) answered Yes

Entry

How to attach events to dynamically created cells and also pass the cell into the event handler ?

Mar 24th, 2003 02:20
Klaus Bolwin, Venkat Raman,


var cell = document.createElement("td");
var event1 = document.createAttribute("onmouseover");
    event1.nodeValue = "functionname(parameterlist)";
    cell.setAttributeNode(event1);
    document.getElementById(row).appendChild(cell);
due to the unsufficient DOM-support of the MSIE, it may work in Mozilla
and other Gecko-browsers only