We help IT Professionals succeed at work.

javascript html table dom hide row by rowid

KeithMcElroy
KeithMcElroy asked
on
How do I get sample a to work, using the id of the row?

Sample A: Javascript code errs:
var postable = GetElement("tblpos")
postable.rows['funding'].style.display = "none"

Sample B:
Javascript code succeeds:
var postable = GetElement("tblpos")
postable.rows[1].style.display = "none"

<table id=tblpos>
<TR id="ratepayi'">
<TD class=label vAlign=top align=right>Rate of Pay $</TD>
<TR id="funding'">
<TD class=label vAlign=top align=right>Funding Source</TD></TD></TR>
</table>
Comment
Watch Question

Commented:
Maybe you can try getElementById() instead.  

Reference:
http://www.w3schools.com/jsref/met_doc_getelementbyid.asp

Explore More ContentExplore courses, solutions, and other research materials related to this topic.