473,395 Members | 1,936 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Creating a hyperlink dynamicaly in TD

Hi All!!

We want to create a hyperlink dynamically in an html table TD.

We have tried the following and evenon some internet sites the code examples are samilar but the adding to the td part is not there.. any other settings that we do to the td are being reflected expect creating a hyperlink for the TD content. We could even add an image using similar code but not a hyperlink. Any suggestions?

Expand|Select|Wrap|Line Numbers
  1. var td = document.createElement("TD");
  2. var link = document.createElement("A");
  3. link.setAttribute('href','#');
  4. link.appendChild(text);
  5. td.appendChild(link);
Regards,
Leena
Aug 24 '07 #1
1 6651
dmjpro
2,476 2GB
Hi All!!

We want to create a hyperlink dynamically in an html table TD.

We have tried the following and evenon some internet sites the code examples are samilar but the adding to the td part is not there.. any other settings that we do to the td are being reflected expect creating a hyperlink for the TD content. We could even add an image using similar code but not a hyperlink. Any suggestions?

Expand|Select|Wrap|Line Numbers
  1. var td = document.createElement("TD");
  2. var link = document.createElement("A");
  3. link.setAttribute('href','#');
  4. link.appendChild(text);
  5. td.appendChild(link);
Regards,
Leena

Hi Leena,
You did a liittle mistake there.
Expand|Select|Wrap|Line Numbers
  1. link.appendChild(text); //This is rong
  2. link.text=your_text;       //This is right
  3.  
Try this one I think it will work fine.
Best of luck with your try.

Kind regards,
Dmjpro.
Aug 24 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: minigitoo | last post by:
Hi I try to get dynamicaly all requests made to DB2 I process like this: 1) I stop then start my instance of database in the db2 control center 2) I use : db2 update monitor switches using...
3
by: Joe | last post by:
I have a table with hundreds of hyperlinks in one field (defined as a hyperlink field) and a short name for each link in another field. I can successfully export a report to HTML with the short...
1
by: Dixie | last post by:
I wish to add some fields to an existing table in code. I am using the following code from rkc. CurrentDb.Execute ("ALTER TABLE MyTable ADD MyNewField Text 25") This works , but I need to also set...
6
by: epigram | last post by:
I'm using the DataGrid with AutoGenerateColumns set to false and choosing which columns I want in the grid by using the <Columns> attribute. What I want to do is to create a hyperlink out of one...
2
by: SAL | last post by:
I would like to create a VB.net function, that builds a dynamic hyperlink using System.Web.UI.WebControls.HyperLink, but I can not find any examples on how to generate a dynamic hyperlink. Has...
5
by: sam | last post by:
Hi all, I am dynamically creating a table rows and inerting radio buttons which are also dynamically created. Everything works fine in Firefox as expected. But I am not able to select radio...
3
by: czi02 | last post by:
Does anybody knows how to hyperlink to another page.. My problem does not running.... I had a web page just like this: WELCOME TO MY PAGE ...
4
by: mramsay | last post by:
Hi, I'm having a real problem creating a dynamic hyperlink for my website. I want to pull the field name from mysql table. Field name is description. I would like this to be a hyperlink on my...
2
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi, I am creating emails dynamically using C# and would like to place a hyperlink in the email body before sending it out. I added the text for what I thought was a hyperlink but the email just...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.