5/14 question about removing paragraph


Can someone explain me why in this exercise

$("p").remove(); works


$($paragraph).remove(); doesn't ??

And does anyone got freeze screen after trying to type $($in code ?


Because you haven't declared the variable $paragraph. to declare it it should look like this $paragraph = $("p");


Sorry, my bad. I did declare it in my code just didn't show it here, That's why I am asking why is not working.

It does remove it in code when you look at it but code asks directly to remove paragraph only using $("p").remove();


I was having the same problem, for the code that worked I had

    var $p = $('<p>Hi</p>')


But when I had this:

    var $p = $('<p>Hi</p>')


it didnt let me go on. technically both codes did the job, But the lesson was asking for you to remove the p tag, so technically the first code does that while the second tag removed the variable $p. But i could be wrong.


the first problem worked the other one didn't so technically the first one works better