Codecademy doesn't accept my right code


#1

Iam at the .remove(); but codecademy doesn't accept it and my code is right

Instructions:Go ahead and .remove() your <p> tag from the HTML document.

My code

$(document).ready(function(){
    var $p = $('<p>My text</p>')
    $('#two').after($p);
    $($p).remove();
})

It works and the p has been removed but codecademy doesn't accept
Errors:Oops, try again. Make sure you remove your <p> using the .remove() function.
is there anything wrong here


#2

normally that would work, but for this exercise to work you need to use $("p") or $('p') to select the paragraph element, the exercise doesn't allow the use of a variable


#3

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