4/14 Modifying HTML Elements - help?


#1

My code syntax doesn't have an errors but I get an error saying it looks like <p> is still after the div #one when I try to save/submit Can anyone tell me what is off about this?

$(document).ready(function() {
    $("#one").after($("<p>Hello</p>"));
    var $div = $("#two");
    $("#two").after($("<p>Hello</p>"));
})

#2

Hi Macaronimonster44,

Which exercise are you on?


#3
How I understood, you are on exercise "Moving Elements Around". Here is code:

$(document).ready(function (){
        var $divtwo = $('div #two');
        
        $divtwo.after('<p>Text</p>');
    });

#4

That didn't work for me, but I was able to this code to work.

$(document).ready(function () {
$("#one").after("I'm a paragraph!");
$("#two").after($("p"));
});