JQuery Programmer Question:

What is the difference between $('div') and $('<div/>') in jQuery?

JQuery Programmer Interview Question
JQuery Programmer Interview Question

Answer:

$('<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.


Previous QuestionNext Question
What are selectors in jQuery and how many types of selectors are there?How to disable jQuery animation?