470,833 Members | 1,468 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,833 developers. It's quick & easy.

How do I use my string to change values in the HTML doc ?

H
Ok, heres the deal ;

I have my script code like this

var v = "place";
for (var i = 0 ; i < 5 ; i++)
{
v = v + i; // or v = "place" +i;
// Here I want to access the resource in the HTML doc, whos id="place1",
id="place2", etc etc, so how can I do that ?
// like "theValueInv".innerText = "bla bla bla bla"; if the resource
with id="place1" is for ewxample a <p>
}
I hope you clever guys can help this newbie with this ...
TIA
H
Jul 17 '05 #1
1 1290
Sounds like you're needing to use JSP to make the changes. This would
happen on the "server-side" of the processing instead of your JavaScript,
which is running on the "client-side". Then you can substitute your "place"
stuff like this:

v = <%= myNewValue %> + i;

"myNewValue" is a variable you define with your JSP server-side code and it
is inserted into your JavaScript code (in this example) when the HTML
(actually .jsp) file is generated. JSP is a whole new ball game and this is
just one way to do this.......

Larry

"H" <no*********************@hotmail.com> wrote in message
news:eq********************@newsc.telia.net...
Ok, heres the deal ;

I have my script code like this

var v = "place";
for (var i = 0 ; i < 5 ; i++)
{
v = v + i; // or v = "place" +i;
// Here I want to access the resource in the HTML doc, whos id="place1", id="place2", etc etc, so how can I do that ?
// like "theValueInv".innerText = "bla bla bla bla"; if the resource
with id="place1" is for ewxample a <p>
}
I hope you clever guys can help this newbie with this ...
TIA
H

Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Albert Wagner | last post: by
7 posts views Thread by al | last post: by
6 posts views Thread by lisa.lin | last post: by
32 posts views Thread by tshad | last post: by
2 posts views Thread by ILCSP | last post: by
18 posts views Thread by greenflame | last post: by
13 posts views Thread by Freaker85 | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.