2/14 What've I done wrong


#1

Ive typed in my code, im 90% sureive done it correctly but it wont let me go on help

$(document).ready(function() {
$(".info").append('

I\'m a paragraph

');
});

#2

Hi Rachel,

You've got two problems that I see:

  1. You're supposed to be adding something to the body, not .info.
  2. You can't have blank lines inside a string. Try putting your I\'m a paragraph on the same line as .append('.

I hope this helps, let me know if you've got any more questions or if you're still not being passed :)


#3

THANKYOUTHANKYOUTHANKYOU


#6

Why would it not take "body" after giving it a class name?

"<body class="bod"></body>"

$(document).ready(function(){
$(".bod").append("

I'm a paragraph!

");
});

Would not accept this answer. Granted, the instructions didn't say to use a class name, but still the principle was in tact and I've done this for a few other of the lessons.


#7

@giganinja92119 That's probably because the code checker is expecting you to select $('body'), not $(".bod"), so when it runs into something different, it throws an error & rejects your code. Your code works in real life as far as I can tell, but on Codecademy it's best to not do anything besides the instructions :)


#8

I got a question how come this code won't work

$(document).ready(function () {
$("body").append(element);


#9

@tagsurfer18896 You should create a new topic next time, or this time if you still don't understand.
What's element? You need to put some HTML in quotes in there, or use a variable containing HTML and append the variable for anything to get appended to the body. Also, you forgot to close $(document).ready(...);.


#10

i did that so what should i do now?


#11

@tagsurfer18896 N e w   t o p i c .
Getting this topic off track makes it harder to help you, and it also makes it harder for people having the same issue as you to find the solution if you don't create a new topic.
Thanks!


#12

$(document).ready(function()
$('body').append('p' i'm a paragraph'p')
what is wrong with this code?


#13

@tagsurfer18896

N E W   T O P I C

 
If you're not sure how to do that, hover your post, then click the "Reply as linked Topic" text to the right of it.
Someone will help you over there.
Thanks!


#15

This topic is solved.