dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: getting selected value of drop down list inside a table

Hybrid View

  1. #1
    Join Date
    Nov 2012
    Posts
    1

    getting selected value of drop down list inside a table

    i have table in which there is a comboBox.does any onw know how to get the selected value of drop down list ...
    i am getting all values of a list using following statement

    document.getElementById("table").rows[1].cells[0].innerText;
    it returns all elements of a list. but i want to have only selected value.

  2. #2
    Join Date
    Nov 2012
    Posts
    1
    Instead of getting a reference to the table object, directly get the drop down list (see example below)

    var dropDown = document.getElementById("[id of drop down here]");

    var selectedValue = dropDown[dropDown.selectedIndex].text;

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles