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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:42:15+00:00 2026-06-06T08:42:15+00:00

I have here a list of items in a table. Each item has a

  • 0

I have here a list of items in a table. Each item has a “Select” button on the right. Whenever the user clicks the “Select” button the item or text on the left of the button should display on the span. What happens is when I click the “Select” button all the items is being displayed on the span.

To see the actual scenario: http://jsfiddle.net/HnAnu/

My code is down below:

<html>
<head>
 <script type="text/javascript" src="jquery.1.7.2.min.js"></script>
 <script type="text/javascript">
  $(function() {
   $(".btnSelectItem").click(function () {
    $("#spanItemDescription").html("<u>"+$(".tdItemDescription").text()+"</u>");
   });
  });
 </script>
</head>
<body>
 <div>
  <span>Item: </span>
  <span id="spanItemDescription">____________________________</span>
 </div>
 <table border=1>
  <tr>
   <td class="tdItemDescription">Shin Guard Small</td>
   <td><input type="button" class="btnSelectItem" value="Select"/></td>
  </tr>

  <tr>
   <td class="tdItemDescription">Shin Guard Medium</td>
   <td><input type="button" class="btnSelectItem" value="Select"/></td>
  </tr>

  <tr>
   <td class="tdItemDescription">Shin Guard Large</td>
   <td><input type="button" class="btnSelectItem" value="Select"/></td>
  </tr>
 </table>
</body>
</html>

Please help me. Thanks in advance.

  • 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-06T08:42:18+00:00Added an answer on June 6, 2026 at 8:42 am

    Please try this

      $(function() {
                $(".btnSelectItem").click(function () {
                    $("#spanItemDescription").html("<u>"+$(this).parent('td').siblings('.tdItemDescription').text()+"</u>");
                });
            });
    

    ​FIDDLE DEMO

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

Sidebar

Related Questions

Here's the problem: A user has a shopping basket containing items, where each item
I have a listing of items on a site. Each item has several categories
I have a list where each item is a row in an sqlite table,
I have a list where each item is a row in an sqlite table,
Here is the problem: I have a list of items with various length for
Here's the problem: I have a data-bound list of items, basically a way for
Here is my situation: I have one table that contains a list of drugs
I have a table (Dataview) with content from a database, where each row/object has
I have the following problem: I have to list several items each with several
So I have a to-do list of items that are dynamically populated by user

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.