We help IT Professionals succeed at work.
Get Started

Delete table row based on element ID

Last Modified: 2011-10-03
I have a dynamic table which has a number of rows like this:

<table id="wpt_tb">
<tr id="tb28791794">
<tr id="tb28792890">

I want to be able to remove 1 of the rows from the table
 I tried this code but it does not work:

var tb = document.getElementById("wpt_tb");
var rw = document.getElementById("tb28791794");

In Firefox it generates this error:
uncaught exception: [Exception... "Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [nsIDOMHTMLTableElement.removeChild]"  nsresult: "0x80004003"

In Internet Explorer it gives error "Invalid argument"

Please help! Thanks.
Watch Question
Software Engineer
This problem has been solved!
Unlock 1 Answer and 14 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE