Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting element access inside div
Message
From
19/10/2017 04:37:58
 
 
To
18/10/2017 17:04:24
General information
Forum:
Javascript
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01655076
Message ID:
01655081
Views:
43
>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()?

.getElementById() is only available on the document,,,,
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform