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 .live()? : jquery mobile

0 Answers  


What is jquery selectors? Give some examples.

0 Answers  


Explain jquery.noconflict? : jquery mobile

0 Answers  


What is the use of jQuery load method?

0 Answers  


Explain the difference between $(this) and 'this' in jquery?

0 Answers  






How to revert the most recent ‘destructive’ operation, changing the set of matched elements to its previous state using ?

0 Answers  


What is the name of jquery method used for an asynchronous http request?

0 Answers  


Define each() function in jquery?

0 Answers  


How can events be prevented from stopping to work after an ajax request?

0 Answers  


How to check or uncheck all checkboxes using jquery?

0 Answers  


How do you attach a event to element which should be executed only once?

1 Answers  


Explain the use of the $.fn.bind and $.fn.trigger.

0 Answers  


Categories