access elements inside <div> tag

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kenneth

    access elements inside <div> tag

    This is probably very simple question but how do you access elements
    inside the <div> tag?

    I need to access the value of a textfield inside a <div> tag.

    Thanks.
  • RobG

    #2
    Re: access elements inside &lt;div&gt; tag

    Kenneth wrote:[color=blue]
    > This is probably very simple question but how do you access elements
    > inside the <div> tag?
    >
    > I need to access the value of a textfield inside a <div> tag.
    >
    > Thanks.[/color]

    Whether your text field is inside a <div> tag or not is probably not
    relevant to how you access it.

    If the text field is in a form, you can get access to it from the
    forms collection. If it's not in a form, give it an ID and use
    getElementById. A quick search of this news group on:

    "document.f orms[" or "document.getEl ementById"

    will turn up hundreds of examples.

    You could also use getElementsByTa gName, but I suspect one of the
    above methods will be better.


    --
    Rob

    Comment

    Working...