Link to home
Start Free TrialLog in
Avatar of steve_steele
steve_steele

asked on

row.onClick="alert()" when building table using javascript

var row = table.insertRow(0);
row.className = "lb"
row.vAlign="top"
row.onClick="alert()"

i'm trying to modify a table and include an onClick event handler, as far as i can tell this should work

any ideas
Avatar of boblah
boblah

Hi steve_steele,

try

row.onClick=function(){alert();}


Cheers!
steve_steele,

or, if you want to make use of the event arguments:

row.onClick=function(e){alert();}
ASKER CERTIFIED SOLUTION
Avatar of cLFlaVA
cLFlaVA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of steve_steele

ASKER

that sorted it thank you very much