Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding attributes to table rows

Status
Not open for further replies.

dougalim

Programmer
Mar 1, 2007
23
US
If I create a table with

t=document.createElement('table')

and then insert a row

r=t.insertRow(0)

how do you add onclick='func()' to the row?
 
Code:
t.rows[0].onclick = function () {
   alert("hi");
};

-kaht

Looking for a puppy? [small](Silky Terriers are hypoallergenic dogs that make great indoor pets due to their lack of shedding and small size)[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top