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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:18:52+00:00 2026-06-05T09:18:52+00:00

When I clone something, I want to clone it as a duplicate consecutive element

  • 0

When I clone something, I want to clone it as a duplicate consecutive element and add a separate identifier to it.

Doesn’t work: $(".selecter").clone().after(".selecter").addClass('.selecter2');

jQuery should make a .cloneAs() or something..

What can we do about 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-06-05T09:18:54+00:00Added an answer on June 5, 2026 at 9:18 am

    From what I can tell by your question, it seems like you want to use .insertAfter rather than .after.

    Note also that addClass should contain only the class name, which presumably doesn’t contain a dot.

    $(".selecter").clone().insertAfter(".selecter").addClass('selecter2');
    

    Demo

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

Sidebar

Related Questions

http://jsfiddle.net/p57hm/ I simply want one more clone on each click. Did i miss something
i am trying to 'clone' an element and delete old, i want to do
Is there an easy way to return something to your code if a duplicate
The following happens to me from time to time: clone something from github discover
Is it possible to modify the clone helper that jQueryUI creates with draggable element?
I'm using LINQ to SQL and after I submit some changes I want to
I cloned something from git repository, and switched branch git clone ssh://11.21.3.12:23211/dir1/dir2 dir git
hi i want to make a OmmWriter clone for my shell terminal. in python
If I want to add a plugin that's in a local directory outside the
I want to do something like: MyObject myObj = GetMyObj(); // Create and fill

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.