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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:09:12+00:00 2026-05-23T04:09:12+00:00

If we click the Add link, a new input should be added to the

  • 0

If we click the “Add” link, a new input should be added to the form.

Also, there should be link “Delete” near each added input. If we click on it, this input should be removed.

How do I do this?

  • 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-23T04:09:13+00:00Added an answer on May 23, 2026 at 4:09 am

    I’m struggling whether to vote to close this as a duplicate, even though it’s not exact. But what you’re looking for appears to be answered here. The main difference is that where they are binding to the change event for a select element:

    $("#selectBox").change(function() {
    

    you would instead bind to the click event of an anchor element (your “Add” link):

    $("#addLink").click(function() {
    

    The “Delete” link would work in a similar manner. As the HTML is created for the new input, you’d also create the “Delete” link to go next to it before adding it to the DOM (the call to the .html() function in the referenced code). You’ll want to make sure that you give the added HTML a unique id (wrapped in a div with a unique id for example), as well as to the added “Delete” link.

    Then, after it’s added to the DOM, you’d add an event handler to the “Delete” link:

    $("#deleteLink123").click(function() {
    

    In this handler you’d reference the unique id of the container of what was added to the DOM and remove it. I’m sure there’s a more elegant way to handle this by using the .live() function here and some more clever selectors. It would be interesting to re-factor something like this while trying to not be too clever so as to hurt ongoing support.

    There are some additional considerations you’ll want to keep in mind as you develop this:

    1. The anchor tags are by default links, but it looks like you don’t want them to link to anything. You can link them to “#” but that’s not really elegant. You could remove the href attribute from them entirely, but then you’ll also need to style them to visually behave like links. Not difficult, but not intuitive either. Why not buttons?
    2. How the actual form behaves when handled by the server is up to you. You can dynamically add elements to the DOM to your heart’s content, but that may not help you on the server-side. That’s another question entirely, though.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

why after each times add and remove new input link remove and add repeat
I have the following bit of code, simply: $(function() { $('a.add-photos-link').live('click', function(e) { $(this).colorbox({
I'm using Expression Blend 3 I click on add live datasource, add new xml
I am using jquery to add mulitple new addTask form elements to a ul
I am using jquery to clone a form input field when user click on
When I click Add to Compare on a product, a message stating that such-and-such
Project: http://design.vitalbmx.com/fave/news.html When I click Add to favorites button (under main pic), in Chrome
Every time you start Visual Studio, the first time you click Add Reference to
I am trying to build a shopping cart site. When a user click add
I am trying to add click event to one of the widgets that use

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.