empty():
Removes the content but not the tags i.e,div,p,span..etc.remove():
Removes both the content and tagsLive Example jsfiddle: https://jsfiddle.net/akhilreddyyalla/xpvt214o/151716/
Real life example:
Consider a bottle having water,
empty() : empty the bottle i.e, emptying the water from bottle but the bottle exists.
remove(): remove the bottle i.e, removing bottle with water.
Comments
Post a Comment