4. Moving elements around - please help, I'm lost


I don't understand this one at all.

"move your <p> tag after the <div> with id #one". Didn't I just do exactly that in the excersise before? ("add a <p> tag .after() the <div> with the ID #one")

And how do I "create a new jQuery selector that targets the <div> with the id #two"?
Like this? :

var $selector = $('#two');

How can I use this to move the <p> after #two? I'm sorry, I am completely lost here. The previous excersises were easy, but here I have no idea what am I supposed to do. Please help.


So, what you have to do is add the p tag after the

1 with ID one. To target a specific ID you do this

Hope this helped if it didnt pls reply saying so


It helped, thanks a lot! :smile:


No Problem! Glad to help!!


I was thinking; what if we don't actually know that a paragraph is the element after the first div??I mean, it could be any element. So I used
instead so it captures whatever element it is under the first div but that doesn't work. Is there any workaround this??


You could use the class name. So this:$('Class').after($('class').after())

Happy late Merry Christmass :evergreen_tree: :- )


Cant i just do $('div').after($('div')) ?


No you have to select the particular div at first so you have to get it bu the Id Name.And for the particular task you need a p So like this:


What I don't understand is why use two steps of instructions for one line of code? It threw me off. That could have easily been explained in one step. I can understand maybe the level of understanding that should be had at this point, but still.


I just think this task is not clear at all, it's poorly written.


Agreed, these instructions are not clear at all!


it's all in the tag

$(document).ready(function() {
$('#one').after(' < p > Text < /p > ');
var $x = $('p');


Are you still experiencing that problem?


This was super confusing and I hope they will fix it for future people. Step 1 should have been "Convert your p tag to a variable" and then step two is "now move it after div 2".

They should have explicitly said use a variable.