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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:58:10+00:00 2026-06-14T06:58:10+00:00

Here is what my html looks like: <table border=1> <th></th> <th>ID</th> <th>Name</th> <tr> <td><input

  • 0

Here is what my html looks like:

<table border="1">
        <th></th>
        <th>ID</th>
        <th>Name</th>
        <tr>
            <td><input type="button" value="btn1"><input type="button" value="btn2"></td>
            <td>22</td>
            <td>Hello</td>
        </tr>
        <tr>
            <td><input type="button" value="btn1"><input type="button" value="btn2"></td>
            <td>25</td>
            <td>HTML</td>
        </tr>
        <tr>
            <td><input type="button" value="btn1"><input type="button" value="btn2"></td>
            <td>45</td>
            <td>CSS</td>
        </tr>

    </table>

Based on this structure of the html, which is being emitted by asp.net I want to add class on the first btn only of each row.

I tried using this but what happen is that even the second button of the td is also being selected:

 $(function () {

            $t = $('#GridView1 td').children().addClass('first');


        })

Sir/Ma’am your answers would be of great help. Thank you++

  • 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-14T06:58:12+00:00Added an answer on June 14, 2026 at 6:58 am

    If I understand correctly, you need to select the first input in the first td in each tr. Try:

    $("#GridView1 tr > td:nth-child(1) > input:nth-child(1)").addClass("first");
    

    Of course, the less strict but more concise

    $("#GridView1 input:nth-child(1)").addClass("first");
    

    could also be used, but this assumes you aren’t using inputs anywhere else in your table.

    DEMO

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

Sidebar

Related Questions

Here's a basic view of what my html looks like: <form> <div id=part1> //
I have some HTML that looks like this: <div class=product> Content In Here <div
the html looks like below or you can find it here http://www.vbulletin.org/forum/index.php <!-- login
I have a table which looks like this (in html): <div id=product_grid_one> <table> <tr>
I'm trying to make an html table that looks like this: 1 2 3
I have html that looks something like this: <div> <table> <tr onclick=show();> <td class=cell>Click
I have html like so: <div class=foo> (<a href=forum.example.com>forum</a>) <p> Some html here.... </div>
It looks like I am having a css problem in IE 8. The code
I have some HTML that looks something like this: <div id=zoomed style=display:none; position:absolute;> <a
i am trying to make my page looks like this : Here is an

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.