Results 1 to 2 of 2

Thread: ID In javascript

  1. #1
    Join Date
    Sep 2010
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb ID In javascript

    hi all
    in the following syntax document.getElementById('ID').innerHTML = 'value'; ID here is the element that has to be changed .is there any other way to use this method if the ID is not known.
    Thanks In advance

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    What do you know? You must know something in order to find the right element. The right method depends on the situation-- you can use several other identifiers such as: location (first child element of a known element, for example), class (like id, but can be several elements), type (table, a, div, etc), maybe id based on some other knowledge you can determine?
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

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