Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hiding a table using getElementById (DOM)

Status
Not open for further replies.

mcowen

Programmer
Oct 21, 2001
134
GB
Hi,
I have a standard table that for each row has a link in the 1st cell. When you click this link a row with a cell is added after it and a table is inserted all using the DOM. I want to be able to hide the inserted table when I click the same link again, so I try to use document.getElementById( "id" ).style.display = "none". The DOM table has an id and I can test it using getAttribute("id") but it throws an error ("object req") when I try to use getElementById() function. Is there an alternative method that I should be using?

Thank you for any thoughts.


Matt
 
Sounds like there's a bug somewhere in the code, because I think that should work if done correctly. Try posting a brief snippet of the code that is causing the error, so we can see what is being done.

News and views of some obscure guy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top