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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:20:32+00:00 2026-05-11T01:20:32+00:00

I have some AJAX work that brings across an additional form element that I

  • 0

I have some AJAX work that brings across an additional form element that I don’t need in the DOM. I don’t have the ability to remove it server side, so I’m looking for some jQuery or classic JavaScript that will allow me to capture all the child elements of the form, remove the form I don’t need and finally re-append the child elements back to the DOM.

Any help would be much appreciated

EDIT: Thanks for the quick answers, the below is what I actually used and it works perfect

            // Captures the children             var children = $('form:eq(1)').children();             // Removes the form             $('form:eq(1)').remove();             // append the child elements back into the DOM              $('#fillDiv').append(children); 
  • 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. 2026-05-11T01:20:32+00:00Added an answer on May 11, 2026 at 1:20 am

    Rather than using the .html() method (which will cause you to lose any events associated with form elements) you should move the child nodes:

    // grab the child nodes var children = $('#badForm').children(); // or var children = $('#badForm > *');  // move them to the body $(body).append(children);  // remove the form $('#badForm').remove(); 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some data that I need to associate with specific element such as
I have some forms that communicate with server using AJAX for real reasons: cascade
I have some jquery code that is doing an ajax lookup and returning comma
I have some content that I am loading using jquery ajax. The content has
I have some jQuery code. I have called an Ajax function file, file.php, that
I have some event handlers that work in FF and not in Safari. Simply
I have a user control that I'm creating that is using some AJAX in
I have some common javascript functionality that I want to share across several views/pages.
I have some java script that work behind a navigation menu, the user clicks
I have some tricky AJAX code on a form, and sometimes it will fail

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.