Expanding / grow a JQuery element selection?

Posted by HipHop-opatamus on Stack Overflow See other posts from Stack Overflow or by HipHop-opatamus
Published on 2010-04-18T16:39:22Z Indexed on 2010/04/18 16:43 UTC
Read the original article Hit count: 227

Filed under:
|

In the Jquery example below, I would like to expand $(this) before it is cloned, so it includes everything contained in the parent class "comment". How do I do this? I've tried using ReplaceWith($(this).parent('.comment').clone()... and it does not work!

$(document).ready(

function(){ 

$('.forumthreadtitle').siblings().hide(); 
$('.forumthreadtitle').click( function() {
$('#first-post').replaceWith($(this).clone().attr('id','first-post'));

});

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-selectors