locked
How define a element name RRS feed

  • Question

  •  How define a element name in getElementById()
    Thursday, February 26, 2009 1:25 PM

Answers

  • Hi Elka,
        You dont define an element in this function but you provide a name of an existing element to the getElementById function. I guess your problem might be how to find out the name of the element that you want to get a reference too.

    You can use tools like the "IE Developer Tool Bar".

    H. 

    • Marked as answer by Elka_ Thursday, February 26, 2009 2:48 PM
    Thursday, February 26, 2009 1:59 PM
  • Actually you provide the element's id to getElementById(), not its name.  But you probably have no interest in the element's name anyway, just its id.

    You can view source and hunt for the element you want to get the id from the html.
    • Marked as answer by Elka_ Wednesday, March 4, 2009 7:30 AM
    Thursday, February 26, 2009 8:01 PM

All replies

  • Hi Elka,
        You dont define an element in this function but you provide a name of an existing element to the getElementById function. I guess your problem might be how to find out the name of the element that you want to get a reference too.

    You can use tools like the "IE Developer Tool Bar".

    H. 

    • Marked as answer by Elka_ Thursday, February 26, 2009 2:48 PM
    Thursday, February 26, 2009 1:59 PM
  • Thank you!!! I do it!!! :)
    Thursday, February 26, 2009 2:47 PM
  • Actually you provide the element's id to getElementById(), not its name.  But you probably have no interest in the element's name anyway, just its id.

    You can view source and hunt for the element you want to get the id from the html.
    • Marked as answer by Elka_ Wednesday, March 4, 2009 7:30 AM
    Thursday, February 26, 2009 8:01 PM