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!

How can i display a varible in table cell?

Status
Not open for further replies.

229257

Programmer
Apr 23, 2002
54
GB
New to DHTML, so could someone please help?

I have a drawings search on a company intranet, i want to display a variable that has been assigned in javascript to display this certain table cell.

I have given this cell an id and i can display the variable in alert window. instead of this window i want to display this integer value in this cell.

I assume i use the DOM model to change the value, i can assign it normal text with the line;

lastsearch.innerHTML = &quot;<div align ='center'>Test Last search</div>&quot;;

I am struggling to display a variable named 'lsearch'.

Any help would be greatly appreciated.

229257
 
Try this:

lastsearch.innerHTML = &quot;<div align ='center'>&quot;+lsearch+&quot;</div>&quot;;

You might want to make it:
document.getElementById('lastsearch').innerHTML = &quot;<div align ='center'>&quot;+lsearch+&quot;</div>&quot;;

Rick -----------------------------------------------------------
RISTMO Designs
Arab Church
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top