• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Add a Table Row

 
cara dastoli
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I need some help making an Table Row a Link.
The following code works just fine, however, I don't know how to make the text a link. Can anyone show me an example on how to do this? Please link to any site. Thanks in advance!

Cara

<script language="JavaScript"><!-- Begin
function addRow(id){
var tbody = document.getElementById
(id).getElementsByTagName("TBODY")[0];
var row = document.createElement("TR");
var td1 = document.createElement("TD");
td1.appendChild(document.createTextNode("Please make this a link."));
row.appendChild(td1);
tbody.appendChild(row);

}
// End -->
</script>
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64618
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The same way that you would if you were marking this up in HTML: create an <a> element in which to put the text of the link.
 
cara dastoli
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bear Bibeault:
The same way that you would if you were marking this up in HTML: create an <a> element in which to put the text of the link.

Is it <A> or <A HREF>? Neither one seems to work for me.

Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64618
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A is the tag name. HREF is one of its attributes.

Neither one seems to work for me.


That is not a useful explanation of your issue.
[ July 17, 2007: Message edited by: Bear Bibeault ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic