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 7872321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:10:08+00:00 2026-06-03T02:10:08+00:00

I have a table with 4 cols: <table id=myTable> <th> <td> A </td> <td>

  • 0

I have a table with 4 cols:

<table id="myTable">
  <th>
    <td> A </td>
    <td> B </td>
    <td> C </td>
    <td> D </td>
  </th>
  <tr>
    <td> 
      <span>A-1</span>  <span>A-3</span>  <span>A-5</span>
    </td>
    <td> 
      <span>B-2</span> <span>B-3</span>
    </td>
    <td> 
      <span>C-3</span>   <span>C-4</span>   <span>C-7</span>
    </td>
    <td> 
      <span>D-1</span>
    </td>
  </tr>
</table>

I have a dropdown with A,B,C and D with a change handler (A=1, B=2, etc):

 @Html.DropDownListFor(model => model.TypeID, new SelectList(Model.Types, "Key", "Value", Model.TypeID))

  $('#myTable').change(function () {
    var type = $(this).val();
     if (type == 1) {
        var tr = $('#current tr')[0];
        var td = tr.cells[0].innerHTML;
        var last = $(td).find(':last-child');
        /// how do I get the contents of the last span???
     } else if ( type == 2 ) {
        ...
     }

  });

Finally, a textbox:

  @Html.TextBoxFor(model => model.next)

When the user pics a selection from the drop down, I want to put the appropriate “next” value based on what’s in the last span in the appropritate table cell.
I can’t seem to figure out how to get the last , and extract the value.

  • 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-03T02:10:10+00:00Added an answer on June 3, 2026 at 2:10 am
    $('#myTable').change(function () {
        var type = +$(this).val();
         if (type === 1) {
            var tr = $('#current tr');
            var td = tr.find('td:eq(0)');
            var last = td.find('span:last');
            var contents = last.html();
         } else if ( type == 2 ) {
            ...
         }
    
      });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table CSFT_SuggestionItem with cols like: SuggestionItemID Title Description, etc. ------------------------------------------------------------ 1
i work with php/Mysql i have table with two cols (date , cash) with
I have a table with 3 cols, incremeting id, name, and data What i'm
I have events table which include so many cols besides Id PK and table
I have a security log table with 4 cols: UserID, LOGINDate, LOGINTime, ClickEvents Now
I have the following: TABLE: topics COLS: topicId, categoryId (linking to the categoryId in
I have a set of divs table-like (with rows and cols), to display a
Say I have a table with 3 cols: ActionId, uid & created. I want
I have table TB1 which has the following cols: ID | date --------------------- 1
I have a table named 'computers' with the following cols: row_id computer_id key value

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.