Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7724635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:44:21+00:00 2026-06-01T04:44:21+00:00

I have a HTML table as follows. I want retrieve row values from this

  • 0

I have a HTML table as follows. I want retrieve row values from this table. For retrieving table row values I have written this java script but i’m getting value null for this variable, var score = comrow.cells[2].childNodes[0].selectedIndex;

how can I correctly retrieve selected values of the drop down list?

function adddata(tableID){

  var phraseTable = document.getElementById(tableID);
        var phrrowCount = phraseTable.rows.length;


        for(var i=0; i<phrrowCount; i++) {
            var comrow = phraseTable.rows[i];
           // var comchkbox = comrow.cells[0].childNodes[0];
            var comval= comrow.cells[1].childNodes[0].value;
            var score = comrow.cells[2].childNodes[0].selectedIndex;
           } 
}

<TABLE id="dataTable" name="topkphrase" cellpadding="0" cellspacing="0" border="1">


            <tbody>
                    <TD width="5%"><INPUT type="checkbox" name="chk"/> </TD>
                    <TD width="75%"><input type="text" name="txt" value="" size="100%"/></TD>
                    <TD width="20%">
                        <SELECT name="score">

                            <OPTION value="vimp">V.Important</OPTION>
                            <OPTION value="imp">Important</OPTION>
                            <OPTION value="avr">Average</OPTION>

                        </SELECT>
                    </TD>
            </tbody>
        </TABLE>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T04:44:22+00:00Added an answer on June 1, 2026 at 4:44 am

    Instead of trying to find the <select> object from the table, you can give the <select> a id and use getElementById.

    var selectElement = document.getElementById(selectID);
    console.log(selectElement.value);
    console.log(selectElement.selectedIndex);
    

    You could also use getElementByName to find all select statements with the name “score”.

    var selectElement = document.getElementByName("score")[0];
    console.log(selectElement.value);
    console.log(selectElement.selectedIndex);
    

    You may also want to look into JQuery for doing this as it may make things much easier for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple working PHP script to write an HTML table from a
I have html as follows: html = '<html><table>this is a table<p>some text</p></table><p>text outside of
I have an HTML table that looks like this: ------------------------------------------------- |Column 1 |Column 2
I have a HTML table like this: <table border=1> <tbody> <tr> <td><a href=# class=delete>DELETE
I have a HTML table like this: <table border=1> <tbody> <tr> <td><a href=# class=delete>DELETE
I have an html table rendered page and I want to save it as
I have an HTML table that is defined as follows: <table id=myTable cellpadding=0 cellspacing=0>
I have an HTML table defined as follows: <table border=0 cellpadding=0 cellspacing=0> <tr> <td
I have an HTML table, when any cell is clicked, I want to highlight
I have a table in html as follows <table> <tbody> <tr> <td>test content</td> <td><input

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.