5. Can't pass yet text is removed from HTML viewer


#1



https://www.codecademy.com/en/courses/web-beginner-en-v6phg/0/5?curriculum_id=50a3fad8c7a770b5fd0007a1

I don't know what I am doing wrong, it seems to behave correctly in the html viewer. Thanks!

$(document).ready(function(){
    $p = $('<p>text</p>');
    $(one).after($p);
    $(two).after($p);
    ($p).remove(); // gives error 1
});

$(document).ready(function(){
    $p = $('<p>text</p>');
    $(one).after($p);
    $(two).after($p);
    ('p').remove(); // gives error 2
});


Error 1:
'Oops, try again. It looks like your < p > is still part of your HTML document. Check the Hint if you need help!'

Error 2:
'Uncaught TypeError: "p".remove is not a function'


#2

Two things which you forgot, the quotes ( " " ) and the # (before the one and two)

Also...

Where's the $ at the beggining?

So, the code should look like this:

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

#3

Thanks, this was the code that worked.

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