Web Analytics Made Easy -
StatCounter how to get an element's value? - CodingForum

Announcement

Collapse
No announcement yet.

how to get an element's value?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to get an element's value?

    document.getElementbyId("N").value

    doesn't seem to work. Should that be the method of getting an element's value? I know that document.getElementbyId("N").value=n, sets the element's value to n.

    Basically, what I'm trying to do is.

    function Alpha(k){
    document.getElementbyId(document.getElementbyID("Chicken").value).value=n
    document.getElementbyId("Chicken").value=k

    }

    changing the element that is id'ed by Chicken's value to a new value called n.

    Then, changing Chicken's value to k.

    So, when the next time the function is run, the element with id=k gets the value of n.
    Last edited by lli2k5; Oct 10, 2006, 09:21 PM.

  • #2
    Case Sensitive:
    Code:
    document.getElementById('objid').value;
    Helping to build a bigger box. - Adam Matthews

    Comment


    • #3
      And here as well.

      Code:
      document.getElementById("Chicken").value

      Comment


      • #4
        Thanks

        Comment

        Working...
        X