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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to pass array[x] to a variable?

Status
Not open for further replies.

ksquared3

Programmer
Sep 2, 2007
18
US
I would like to pass array[x] to a variable so that I can use .innerHTML to replace the contents of a div with the variable. I've searched for hours and don't find any reference.

Any help is appreciated! Big thanks.
 
What do you mean with a variable? A string? What is inside the array?

Cheers,
Dian
 
Hi

In addition to Dian's questions : why ?

array is a variable, why would you need another ?
Code:
document[teal].[/teal][COLOR=darkgoldenrod]getElementById[/color][teal]([/teal][green][i]'in_case_your_div_has_an_id'[/i][/green][teal]).[/teal]innerHTML[teal]=[/teal]array[teal][[/teal]x[teal]][/teal]
Maybe the point is, array is not JavaScript variable ? Than you will have to provide more details.


Feherke.
 
Thank you. I did solve this problem which after all was with the creation and filling of the array not the .innerHTML
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top