Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting element access inside div
Message
From
18/10/2017 17:04:24
 
 
To
All
General information
Forum:
Javascript
Category:
Coding, syntax & commands
Title:
Getting element access inside div
Miscellaneous
Thread ID:
01655076
Message ID:
01655076
Views:
46
I have a div which contains some HTML.

I can do this:
loElements=loDiv.getElementsByTagName("form")
This will contain all the forms.

If I do this:
for (lnCounter=0; lnCounter<loElements.length; lnCounter++)
{
   alert(loElements[lnCounter].id)
}
...it shows me Form1.

As I only need to access one form, I thought of changing this to:
loForm=loDiv.getElementById("Form1")
But, this doesn't work. Javascript stops.

Why can't I access it directly with getElementById()?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Next
Reply
Map
View

Click here to load this message in the networking platform