Need help with "Before & after"


I have tried many different entries and even went on youtube, but i'm still getting this exercise incorrectly. Below is the error message that I keep getting. Please help. Thanks
Oops, try again. It looks like you didn't insert your

after the

with ID #one.

$(document).ready(function() {
$('div ID#one').after('<p>hopefully this works</p>');



$(document).ready(function() {

hopefully this works


try this


Thanks @miguell997 for the reply, but that too didn't work.


I figure out what my mistake was.


what is it?? I need help..... :frowning:


Hi there. When you place the

tags for the element you're placing after div #one, don't put it between
"". Those were just used as examples to represent any tag that you would use, be it a p,
h1, div, etc. tag. Hope this helps.


var $paragraph = $("p");

The target (#two) is where you want to PUT the paragraph. This exercise was worded a little weird but if you refer to the previous exercise again that might help you understand.


Hello. From the code you provided, this would be the correct way to solve it:

$(document).ready(function() {
  $('div#one').after('<p>hopefully this works</p>');

This way you say "give me div element where id equals one".


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