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

  • Home
  • SEARCH
  • 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 7592111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:49:30+00:00 2026-05-30T20:49:30+00:00

I am using to add a some rows using javascript. I was able to

  • 0

I am using to add a some rows using javascript. I was able to achieve that using:

$('#order_basket > tbody:last').append('<tr><td><b>'+Book+
             '</td><td>'+Type+'</td><td>'+'<span onclick="removeRow()"'+
             'class="label label-important">Remove</span></td></tr>');      
        return false;
});

Now i also want to be able to remove that row using javascript too. In the able code i have a label named as Remove which is calling another function in my javascript that is being used to remove the selected row. However i am unable to achieve that. The code i am using to remove the row is:

function removeRow() {
    $(this).parent().remove();
    return false;
}

Any help will be appreciated!

  • 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-05-30T20:49:31+00:00Added an answer on May 30, 2026 at 8:49 pm

    You have to pass this inside the onclick event as follows:

    '<span onclick="removeRow(this)"'
    

    And change the function to:

    function removeRow(row) {
        $(row).closest('tr').remove();
    }
    

    Instead of passing the event as an attribute via the HTML, you can also use:

            $('#order_basket > tbody:last').append('<tr><td><b>' + Book +
                 '</td><td>'+Type+'</td><td>'+'<span'+
                 'class="label label-important remove">Remove</span></td></tr>');      
            return false;
    });
    
    $('#order_basket > tbody:last').on('click', 'span.remove', function() {
        $(this).closest('tr').remove();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having some trouble with some javascript. I'm using jQuery to dynamiclly add rows
Using javascript, how do I add some data to the query string? Basically I
I want to add some style to head tag in html page using javascript.
I need to add markup to some text using JavaScript regular expressions. In Python
I want to add some rows to a database using Linq to SQL, but
I'm trying to add and remove some rows from a table using Jquery. But
Hi again :) I'm using jQuery script to show/hide some content: <script type=text/javascript> $('.toggleButton').click(function()
I am using jQuery to add some dynamic content to a website. I am
I am using PostSharp to add some compile time logic to my attributes -
I'm trying to add some HTML formatted text to Word using Office Interop. My

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.