5. removing elements


#1


I have already finished this I have a question about this certain code so when I had passed leaving the ); out and when I wanted to have the correct thing I put the parentheses on it says there is a script error.
The code I put below is the one with the script error



$(document).ready(function() {
    $('#one').after("<p> REPTILLIAN ARMY  UNITE </p>");
  
});
$(document).ready(function() {
 $('#two').after($("p"));

});
$(document).ready(function() {
    $('div').remove('<p>');
    
});


#2

HI the error come from this part

$(document).ready(function() {
    $('div').remove('<p>');
    
});

the .remove() work like that

$('element to remove').remove();

in your case you will put 'p' and not '<p>' where it's write 'element to remove'


#3

thanks marco Can you please explain a little more about the remove function


#4

you can read more about it here
https://api.jquery.com/remove/


#5

Wizmarco you are a saint


#6

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