tags:

views:

25

answers:

2
function moveAround(){
$('p').append($('#div'));
}

Above code will move "div" after "p" element as a child. I don't want like that. I just want "div" append after "p" but still same level with "p". What shall I do? Thanks in advance!

+1  A: 

Have you read the docs? See .after() and .before().

jholster
+2  A: 

Use after

function moveAround(){
  $('p').after($('#div'));
}
Matt