Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Dom setAttribute ondblclick & ID for Table row/cell

Posted on 2001-09-02
3
Medium Priority
?
646 Views
Last Modified: 2006-11-17
Hi,

How do I add an onDblClick event for each table TR being created & how do I add an ID for each Cell being created.

function addRow(val1,val2)
{
tabBody = document.getElementsByTagName("TBODY").item(3);
row = document.createElement("TR");
cell1 = document.createElement("TD");
cell2 = document.createElement("TD");
textnode1 = document.createTextNode(val1);
textnode2 = document.createTextNode(val2);
cell1.appendChild(textnode2);
cell2.appendChild(textnode1);
row.appendChild(cell1);
row.appendChild(cell2);
tabBody.appendChild(row);
}

0
Comment
Question by:kingasa
  • 3
3 Comments
 
LVL 15

Expert Comment

by:a.marsh
ID: 6448746
row.onclick = function { /* code here */ }

row.id = "id_here";


:o)

Ant
0
 
LVL 15

Expert Comment

by:a.marsh
ID: 6448752
Sorry, make that:

row.onclick = function() { /* code here */ }


Ant
0
 
LVL 15

Accepted Solution

by:
a.marsh earned 200 total points
ID: 6448756
Let's get this right!

row.ondblclick = function() { /* code here */ }

and

cell1.id = ""id_here";

etc.

Ant
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question