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



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

Answer / chaitanya

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

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More jQuery Interview Questions

Explain various methods to make ajax request in jquery?

0 Answers  


How to add and remove css classes to an element using jquery?

0 Answers  


Explain jquery $.ajax() method?

0 Answers  


Explain .bind() vs .live() vs .delegate() vs .on()

2 Answers  


Can you use multiple document.ready() function on the same page?

0 Answers  






Can we call c# codebehind method using jquery?

0 Answers  


How to find all sibling elements in front of the current element using ?

0 Answers  


Explain .delegate()? : jquery mobile

0 Answers  


Is jquery a library for client scripting or server scripting? : jquery mobile

0 Answers  


Please tell us that is jquery knockkout intended to compete with jquery or prototype or work with it?

0 Answers  


Is jQuery replacement of Java Script?

2 Answers  


What are the various ajax functions?

0 Answers  


Categories