CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2006
    Posts
    15

    get ElementById in firefox

    hay all,
    in IE I get get a reference to an element inside an element by using
    document.getElementById('FirstelementName').document.getElementById('SecondelementName').
    but it does not work in firefox.
    how can i get the reference to the second element?

  2. #2
    Join Date
    Feb 2005
    Location
    Denmark
    Posts
    742

    Re: get ElementById in firefox

    What does document.getElementById('SecondelementName') return to you?

    Also be sure that you actually use the ID and not the name to getElementById with. IE is rather lenient when it comes to getElementById() that it'll also look up the name attribute in case it doesn't find stuff. (Have caused me grief more then once)

  3. #3
    Join Date
    May 2002
    Posts
    10,943

    Re: get ElementById in firefox

    To add to this...

    Your code below does not make sense. Those are two different statements and should be split at the middle period. The only reason that IE should be understanding them is if Microsoft glitched again.
    Code:
    document.getElementById('FirstelementName').document.getElementById('SecondelementName')
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured