SEMrush

Tuesday, 8 November 2016

empty() in JQuery


empty() in JQuery


empty() in jquery is used to empty the entire content of a selected element.the usual syntax as follows.
  
$(selector).empty();

eg:-
<p id="element">contents here</p>
$("#element").empty();

which will delete the contents (ie, which make an effect like <p id="element"> </p>

No comments:

Post a Comment