473,395 Members | 2,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 1373
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Albert Wagner | last post by:
What is the evaluation context of the setTimeout args below? I have a separate Timer instance for each sprite in my program. As coded, "this.Clock" doesn't work. Thanks ahead for any advice. ...
15
by: Bushido Hacks | last post by:
Hey c.l.c++ and/or c.g.a.opengl posters, How do I convert a hexidecimal string, traditionally used for defining colors with HTML, into a floating point array? In other words, how do I convert...
7
by: al | last post by:
char s = "This string literal"; or char *s= "This string literal"; Both define a string literal. Both suppose to be read-only and not to be modified according to Standard. And both have...
6
by: lisa.lin | last post by:
Hi,all Is there any library function to tell a string to be a number? I did't find it in <string.h>, does anyone kow? Thanks in advance! Lisa Lin
6
by: Chris Simmons | last post by:
I know that a String is immutable, but I don't understand why this piece of code fails in nUnit: // BEGIN CODE using System; class Test { public static void Main( String args )
32
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if...
15
by: Kapil Jain | last post by:
Dear All, What i need to achieve is : I am generating dynamic text boxes thru dhtml coding, i need onChange event of oragnistation text box i.e dynamically generated on click of "More" button in...
2
by: ILCSP | last post by:
Hi, I have a sql table containing the answers for some tests. The information in this table is presented vertically and I need to create strings with them. I know how to read the data in VB.Net...
18
by: greenflame | last post by:
I want to make a function that does the following. I will call it thefunc for short. '||Char>>' I tried the following def thefunc(s): s = "||" + s + ">>"
13
by: Freaker85 | last post by:
Hello, I am new at programming in C and I am searching a manner to parse a string into an integer. I know how to do it in Java, but that doesn't work in C ;o) I searched the internet but I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.