3/14 before and after problem


$(document).ready(function() {


can anyone tell me what is wrong with this i have looked everywhere and can't find anything


no semicolon after the closing bracket


The lesson asks us to insert a paragraph element immediately following #one, so first we need to create an HTMLString of a P-node inside the after() argument and chain that to the #one selector:

$('#one')  // target the element `<div id="one">Div #1</div>`
.after()   // the after() method
'<p>Hello!</p>'   // an HTMLString of a P-node

Putting this all together, we get,


Be sure there are no line breaks in your quoted string. Keep everything, including quotes, on the same line.


Hi! I think I have put the right code but it still gives me an error.


Can anyone see the problem here? I have also tried with document ready at the beginning


It's important to use the ready() method to defer our code until after the page HTML has loaded. Until then, #one and #two don't exist yet.

    $('#one').after('<p>My paragraph inserted after #one</p>');