What is the difference between $(‘div’) and $(‘ ‘) in jQuery?

Technology CommunityCategory: jQueryWhat is the difference between $(‘div’) and $(‘ ‘) in jQuery?
VietMX Staff asked 3 years ago
  • $('<div/\>') : This creates a new div element. However this is not added to DOM tree unless you don’t append it to any DOM element.
  • $('div') : This selects all the div element present on the page.