473,405 Members | 2,373 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,405 software developers and data experts.

insert href into table cell using javascript

Hi,

I want to insert href into tabel cell using javascript. Note should support all browser.

I know to insert, but it support only in IE, I checked in firefox, it does not support so please help me.

This is code to insert(works in IE)

Expand|Select|Wrap|Line Numbers
  1. var myLink = document.createElement('a'); 
  2. var href = document.createAttribute('href'); 
  3. myLink.setAttribute('href','javascript:removeRow('+pos+')'); 
  4. myLink.innerText ="Delete"; 
  5. newCell.appendChild(myLink);
May 12 '10 #1
1 3866
Dormilich
8,658 Expert Mod 8TB
.innerText is only supported by IE. either explicitly create a Text node or use .innerHTML or .textContent.

PS. you don’t use line #2 at all …
May 12 '10 #2

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

Similar topics

7
by: Andrew Poulos | last post by:
I'm using the following code to create a small table with one column and two rows. An image goes into the first cell. //create table var t = document.createElement("TABLE"); t.style.position =...
1
by: Karim | last post by:
I have a form built into an html table. One of the form elements is an asp.net dropdownlist. For some options in the listbox, I want to insert a new table row under the listbox to grab some more...
2
by: Joe Fallon | last post by:
I can add items to my dropdown list using javascript like this: cbo.length = j+2; cbo.options.text = "Some Text"; cbo.options.value = "MyValue"; cbo.options.text = "Some Other Text";
1
by: datttanand | last post by:
how to add drop down list in excel cell using javascript code?
1
by: gaya3 | last post by:
Hi, How to insert row in table using javascript when some event occurs in html? -Hamsa
1
by: stepby | last post by:
Dear All, I want to make a function to add a row in the table by click the add button and delete the row by choosing the checkbox at the first of the row and click the delete button. can it...
2
by: progman417 | last post by:
I'm translating one of my old ASP apps into ASP.Net and am having a bit of a problem with something that looks like it should be really easy! In the header row of a table, I want the name of the...
2
by: Vasu | last post by:
Hi! Could anybody help me guide how to write something in between <td></ tdtags. When I try to write through document.write, it wipes the whole table and writes on to a blank document, but when...
7
by: ms026057 | last post by:
I Have a File a.html file Content <html> <body> <table> <tr><td id="table1">this content from b.html</td></tr> </table> </body> <html>
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.