Hi.

I have an HTA which include a span id created on the fly (e.g. <span
id="span" & id & "Status">Bla</span>)

I would like to change the InnerHTML on that span but am having
problems creating the variable on the fly. For example I have tried:

strA = "1" <--equivalant to id in the span
span&strA&Status.InnerHTML = "Blabla"

But that doesn't work. I've also tried

strA = "1" <--equivalant to id in the span
strB = "span" & strA & "Status"
strB.InnerHTML = "Blabla"

And that doesn't work either. Can anyone help me or provide any
suggestions on how I might do this?

Thanks!

Re: Creating variable on the fly in HTA by McKirahan

McKirahan
Fri Feb 23 09:44:06 CST 2007

"Joseph Gruber" <joseph.gruber@gmail.com> wrote in message
news:1172244209.340563.84470@s48g2000cws.googlegroups.com...
> Hi.
>
> I have an HTA which include a span id created on the fly (e.g. <span
> id="span" & id & "Status">Bla</span>)
>
> I would like to change the InnerHTML on that span but am having
> problems creating the variable on the fly. For example I have tried:
>
> strA = "1" <--equivalant to id in the span
> span&strA&Status.InnerHTML = "Blabla"
>
> But that doesn't work. I've also tried
>
> strA = "1" <--equivalant to id in the span
> strB = "span" & strA & "Status"
> strB.InnerHTML = "Blabla"
>
> And that doesn't work either. Can anyone help me or provide any
> suggestions on how I might do this?


Try:

document.getElementById("span"&strA&"Status").innerHTML = "Blabla"