Modifying HTML Elements .after()


#1

$(document).ready(function() {

$('#one').after('<p>Hellos</p>');

})

Not working, copying and pasting other peoples code that they say did work isnt helping either.
No idea why this isnt working. Help?


#2

Hi Evilcookie36,

Please post:

  1. A link to the exercise you're on
  2. The error message you're getting

so we can help you.
Thanks!


#3

Use these ones: " " in stead of single quotes ' '

So the correct code should be:

$(document).ready(function () {

$("#two").after("

I'm a complete new paragraph!

");

});

==================
Kind regards,

Herman


#4

Why ? ' and " is the same....
@hermanhaasnoot00gmai


#5

@dubstepnow

Have you tried both options ?
And have you copied / pasted my code into your text editor?

It should work, At least it did with my code.

Kind regards,

Herman


#6

@dubstepshadow is correct, ' and " work in the same way.


#7

I'am having the same issue. The code above didn't work. My code that I attempted was the same as @evilcookie36


#8

I looked at another thread for help and found this correct answer.

[edited - please don't post code answers]


#10