Skip to content
Justice Tech School

Remove Elements

remove deletes elements and their data, empty clears the children, detach keeps data for reinsertion.

Example
$('#old').remove();
$('#list').empty();
const $el = $('#x').detach();

Exercise

Clear children.

$('#list').()

Quiz Test

What does remove do?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.