Friday, February 13, 2015

Delete Elements in JQuery

1. remove() will delete the selected element(s)

2. empty() will only delete all child elements of the selected element(s)

Syntax: $("#**").remove();  
             $("#**").empty();

3. remove() can have one optional parameter for filtering the elements to be removed.
$('#**').remove('.more'); remove the element with .more class.

No comments:

Post a Comment