Showing results for 
Search instead for 
Did you mean: 

Access Table values with Javascript

Active Contributor
0 Kudos


Can someone show how to access the 2 table <TD> values via javascript and output the values?

The catch is that I'm trying to do this with Javascript using the <DIV> ID "daterange" identifier instead of the Table Name ID. Is this possible?

<div id="daterange"  style="VISIBILITY: hidden" >
     <span id="sapbi_snippet_DATE_RANGE_OUTPUT">
          <table id="DATE_RANGE_OUTPUT_interactive_pivot" border="1px" >

View Entire Topic
Active Contributor
0 Kudos

Hi Kenneth,

getElementByTagName returns an array, so we'll have to loop through and pick up the array elements like this:

var DIV;
var TD;

DIV = document.getElementById("daterange");
TD = DIV.getElementsByTagName("TD");
var TDCount=TD.length;

for ( var i = 0; i < TDcount; i++)
var thtml = TD<i>#innerHTML#

Edited by: Suhas Karnik on Apr 22, 2008 4:07 PM

Active Contributor
0 Kudos

Thanks Andrew and Suhas! I now have what I need. I really appreciate you sticking through to the end!

Points awarded.