Help in Lesson 3 Modifing HTML Elements


#1

I need help.

Place I'm stuck at:
https://www.codecademy.com/en/courses/web-beginner-en-v6phg/0/4?curriculum_id=50a3fad8c7a770b5fd0007a1

I'm getting this message: "Oops, try again. It looks like your

is still after the

with ID #one. "

Replace this line with your code. 
$(document).ready(function(){
$('#one').after('div');
$('#one').after($('p'));

var $paragraph = $('p');
$('#one').after('<p>div</p>');
$('#two').after('<p>div</p>');
});


#4

The first line should create and insert an HTML element.

$('#one').after("<p>I'm a paragraph.</p>");

When this line is run, a new paragraph element appears just below the DIV with id 'one'.

Now we can target it with a selector, and being the only P-node in the page, it will be found. Then we move it.

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

Now it will have disappeared from its first place, and reappear below the DIV with id 'two`.


#5

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