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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:08:26+00:00 2026-06-09T03:08:26+00:00

Please consider following snippet: <div class=row> <div class=span12> <div class=control-group> <label class=control-label>Person Name</label> <div

  • 0

Please consider following snippet:

<div class="row">
    <div class="span12">
        <div class="control-group">
            <label class="control-label">Person Name</label>
            <div class="controls">
                <input type="text" class="input-medium">
            </div>
        </div>
    </div>
</div>

The classes belong to grid-based css framework named ‘bootstrap’ and are used for positioning and styling.

The ‘row’ is inside of the single form. The form provides input for many persons. Each ‘row’ corresponds to a single person with its input details. (in this example I have only one property for simplicity – ‘Person Name’) So I can have many snippets/’rows’ like this in a single form.

What I would like to do is to create a button which would be inside every ‘row’ and whenever it is clicked it would delete the entire row in which it resides, but would not affect other rows which belong to other persons’ input details.

So far as I understood the easiest option would be usage of jQuery’.remove’ method. However it would require id enumeration of every ‘row’ in this case, which I can generate on server-side, but not in this case, lets just assume that it is not allowed – I don’t have ‘id’ attributes and I can’t add them, so I can’t point function at the row id to delete. If I fetch class to ‘.remove’ method the button will obviously delete all the rows.

Just to illustrate the situation. Multiple rows, notice the buttons.

<form>
    <div class="row">
        <div class="span12">
            <div class="control-group">
                <label class="control-label">Person Name</label>
                <div class="controls">
                    <input type="text" class="input-medium">
                </div>
                <div class="control-group">
                    <div class="controls">
                        <button type="button" onclick="deleteTheEntireRow()" class="btn btn primary">Delete Person</button>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="span12">
                <div class="control-group">
                    <label class="control-label">Person Name</label>
                    <div class="controls">
                        <input type="text" class="input-medium">
                    </div>
                    <div class="control-group">
                        <div class="controls">
                            <button type="button" onclick="deleteTheEntireRow()" class="btn btn primary">Delete Person</button>
                        </div>
                    </div>
                </div>
            </div>
</form>

I apologise for formatting.

Essentially what a button must do:
detect and select just its fourth parent ‘row’, so I could apply `.remove’ method.

  • 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-09T03:08:28+00:00Added an answer on June 9, 2026 at 3:08 am
    $("button").on("click", function(e) {
        $(this).closest("div.row").remove();
        e.preventDefault();
    });​
    

    I’ve remove the onclick property in the HTML by the way

    DEMO

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

Sidebar

Related Questions

Please consider the following code: public class Person ( public string FirstName {get; set;}
Please consider the following snippet: class Pin { public: Pin() { } }; class
please consider the following snippet: SimpleDateFormat parser = new SimpleDateFormat(MMdd); parser.setLenient(false); try { Date
Please consider the following java source: package com.stackoverflow; public class CondSpeed { private static
Please consider the following simple use case: public class Foo { public virtual int
Please consider the following three .NET types: I have an interface, an abstract class,
Please consider the following snippet from an implementation of the Interpreter pattern: public override
Please consider the following code, <form action=index.php method=post name=adminForm enctype=multipart/form-data> <input type=hidden name=showtime[] id=showtime_1
Please consider the following code: class Abase{}; class A1:public Abase{}; class A2:public A1{}; //etc
Please Consider the following table : As you can see the Name column has

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.