2/14 Why isn't this working?


#1

$(document).ready(function () {
$("body").append('I\'m a paragraph!');
});


#2

This isnt Working Since...

You needed to add the pargraph method

Problem:

  1. Your Code: $("body").append('I\'m a paragraph!');
  2. My Code: $('body').append("<p>I'm a paragraph!<p>")

If you need the whole code here it is:

$(document).ready(function(){
    $('body').append("<p>I'm a paragraph!<p>") 
        });

Reply to me if it works..


#3

Hi, you should add paragraphs and also if you have any text with single quotes, than you need put your text into double quotes and vice-versa. That's why @amanuel2's code works!
Good luck)


#4

First create 'P' tag in index.html, then write jquery append code
$('body').append('<p>I\'m a paragraph!</p>');


#5

It worked but one thing I don't get. The you put the <p> inside the quotation marks. Wouldn't the <p> get printed too ? How come it doesn't ?


#6

I Cant see your code properly... Please format it.