4. Moving Elements Around?


#1

$(document).ready(function() {
    $('#one').after('<p>hello</p>');
    $('#two').after('<p>hello</p>');
});

Oops, try again. It looks like your p is still after the div with ID #one.

code may look strange, fault from code academy doesn't like the "p's"


#2

Hi Telos,

Rather than creating a new <p> tag and putting it after #two, you need to select the current existing <p> element (the one you just added after #one), then put it after #two. Like this:

$('#two').after($('p'));

#3

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.