♦ jQuery empty()
♣ Example2: jQuery empty()
Removes only the child elements from the selected element.Basic Syntax
$(selector).empty(data);
selector: the HTML element to be selected.
empty(): syntax for emptying all the child elements of selected HTML element.
In this example, jQuery empty() method is illustrated.empty(): syntax for emptying all the child elements of selected HTML element.
Example
Input:
Output: