var el = $(this); // it's a form
At some point:
el.replaceWith('<p>Loading...</p>');
Later:
el.replaceWith(output);
Apparently el doesn’t exist anymore after the first replaceWith…
Can I keep somehow el, obviously with the new content ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
The original
elhas been removed and replaced byreplaceWith. Create a new reference, using the return value ofreplaceWith:If you intended to replace the inner content with the new element, while keeping the form, use: