Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Access HTML Element ....

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,41116
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Access HTML Element ....
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Access HTML Element .... - 12/17/2006 6:54:54 PM   
  wijaya_ferry

 

Posts: 3
Score: 0
Joined: 12/17/2006
Status: offline
please give me a code to access html element with name like (text1, text2, text3, ..., textn) . with looping .... ?
 
 
Post #: 1
 
 RE: Access HTML Element .... - 12/17/2006 9:35:31 PM   
  TNO


Posts: 1397
Score: 16
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
Instead of using loops, you can do this:

<div id="MyDiv">Hola Bueno!</div>

document.getElementById("MyDiv")

now if you WANT to use a loop, then lets pretend you have a bunch of divs:

<div>I</div>
<div>AM</div>
<div>NOT</div>
<div>A</div>
<div>ROBOT</div>

I can now access all of those elements like this:

Dim myDiv, obj

myDiv=document.getElementsByTagName("DIV")

For Eachobj in myDiv
   Foo
End For


_____________________________

To iterate is human, to recurse divine. -- L. Peter Deutsch

(in reply to wijaya_ferry)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Access HTML Element .... Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts