Modifying HTML Elements #3. Before and After


#1


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


Oops, try again. Did you create a variable called $h1?


$(document).ready(function(){
    var $h1 = $('<h1>Hello</h1>');
});


is this a glitch?


#3

I'm stuck a few parts ahead

$("#one").after("p>Hello</p");

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

Oops, try again. It looks like you didn't insert your <p after the <div with ID #one.


#5

your code: $("#one").after("p>Hello</p");
Comment: you are missing the opening "<" and ">" on p.

myCode: $("#one").after('

This is the inserted line between div1 & div2

');

#6

you don't need the document.ready
this will sufice.
$h1 = $("

Hello

");

#7

you don't need the document.ready
this will suffice.
$h1 = $("Hello");


#8

Is there such an element as, Hello? No.

$h1 = $('<h1>Hello</h1>');

#9

the reason there is no opening and closing < > is because then it would be considered code by the webpage


#10

I figured the parts on my own


#11

var $h1 = $('

Hello

');
$("#header").after("$h1");

#13

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