Today I Learned

hashrocket A Hashrocket project

jQuery Empty

Today I learned about the jQuery .empty() method.

.empty() removes all child nodes of the set of matched elements from the DOM. Consider it a delete button for whatever element you call it on.

.empty() is equivalent to .html('') but much faster.

h/t Cameron Daigle

See More #javascript TILs
Looking for help? At Hashrocket, our JavaScript experts launch scalable, performant apps on the Web, Android and iOS. Contact us and find out how we can help you.