Tech Off Post

Single Post Permalink

View Thread: getting .value from javascript nodecollection?
  • User profile image

    I have four radio buttons, all with the same Name value, but different Value values.

    <input type="radio" name="cars" value="vw" />
    <input type="radio" name="cars" value="dodge" />


    If there someway I can extract the value of the selected node from that list?

    document.getElementsByName("cars").value type of thing?

    I ended up just doing a loop, and looking for whichever node had .checked as true - but I'm hoping their is a non-loop way to do this.