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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:38:55+00:00 2026-06-01T18:38:55+00:00

I have a button in my table, I want to remove a complete row

  • 0

I have a button in my table, I want to remove a complete row on button click.?
please dont try to modify the logic i used.

Currently when the button is clicked I get its id and based on that id i need to delete an element(complete row) from the DOM having same class name.

JavaScript

$(".removeAKA").click(function () {
    // alert($(this).val());
    var id = this.id;
    alert(id);
    $("." + id).remove();
});

​HTML

<tr class="aka 1" id="sdf">
  <td>AKA 1</td>
  <td><input class="text-box single-line" id="aka_1_" name="aka[1]" type="text" value="2" /></td>
  <td><input type="button" class="removeAKA" id="aka 1" value="Delete" /></td>
</tr>​

Here is my code in a jsfiddle

  • 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-01T18:38:56+00:00Added an answer on June 1, 2026 at 6:38 pm

    Hiya demo if you want to keep the spaces: http://jsfiddle.net/59RA2/9/ OR http://jsfiddle.net/59RA2/31/ OR http://jsfiddle.net/59RA2/32/

    Hope this helps.

    I have replaced spaces to . because spaces is not recognized when Jquery tries interpreting your code.

    or

    You can also use $(this).closest('tr').remove(); to remove the row.

    or
    You can use $("table ."+id).remove();

    Further:

    jQuery: selector (classname with space)

    jQuery remove table row with non-standard id characters

    Quote

    Class names can’t have spaces in them. What you have there is two
    classes:

    This div has two classes: panel and
    current. That’s easily selected:

    $(“div.panel.current”)… That means select all divs that have class
    panel and class current.

    Code

    just replace spaces with . and it will work if you want to else you can have no spaces in-between.

    Have a good one, cheers!

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

Sidebar

Related Questions

I have two tables on a webform. On a button click I want to
i have a table with single row (textfield) and Add Row button, when user
I have a button that when clicked, gets the row in the table that
I have used click_no_wait to click a button and then used javascript_dialog.button('OK').click to click
I have edit button at the last cell of the table. when I click
I have a Table,Button and a Textarea, When a user types inside the Textarea
I've got a gridview that renders as a table. I have an Add button
i have a table which contains a bunch of dynamically created radio button lists,
I have a big table containing a button in each cell. These buttons are
I have a table (in a form) populated with radio buttons (with a button

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.