I have the following simple code, where I double click a div (with class container) and it’s simply clones itself inside another div (with id containment-wrapper):
html
<span class="container">div one</span>
<div id="containment-wrapper">
</div>
Jquery
$(".container").dblclick(function() {
$(this).clone().appendTo('#containment-wrapper');
});
When I double click the original div, it clones itself and puts a div inside the containment-wrapper but when I double click a cloned div, it doesn’t do anything even though it has class=container, why is this happening? I tried many different ways to clone it but nothing worked.
Similar:
- How do I select a child element by ID with jQuery? I’m having trouble selecting the text inside a span element that resides in another container. The situation I’m trying to solve is on the page...
- Help fixing Clone Stamp Tool Issue Hello. I am trying to track down a problem 3 of my users are having with CS4 version of photoshop. When they are trying...
- What is the best Mercurial clone / repository strategy? There can be: 1) just clone from remote repo as needed (each new one can take 20 minutes and 500MB) 2) clone 2 local ones...
- Jquery .wrap and first-child Hi, I’m in a situation in which I need to use .wrap and :first-child. This is what I am doing: <script>$("a").wrap("<div class='category-wrapper'></div>");</script> <script>$("div.category-wrapper:first-child").addClass("first");</script> This should...
- Taking Clone() of a Stream Please help me how to take clone of an Input Stream. I want to take clone of file uploaded through file upload control. ie clone...
Tags: class container, clones, containment, div, double click
[...] Jquery – Clone a div and then clone again from the child | The … [...]
[...] Jquery – Clone a div and then clone again from the child | The … [...]
[...] Jquery – Clone a div and then clone again from the child | The … [...]
[...] Jquery – Clone a div and then clone again from the child | The … [...]
[...] Jquery – Clone a div and then clone again from the child | The … [...]
[...] Jquery – Clone a div and then clone again from the child | The … [...]