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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain all the ways to include jquery in a page?

458


Can you please explain the difference between javascript and jquery? : jquery mobile

434


How to always reference latest version of jquery?

472


Explain jquery connect?

3760


Differentiate between width() vs css(‘width’) in jquery

437






How to disable/enable an element with jQuery?

472


Explain cdn? : jquery mobile

491


What are the types of selectors in jQuery?

522


What is the use of jQuery load method?

515


Why are not some scripts and styles loading? : jquery mobile

450


What are the differences between size and length in jquery?

438


How to concatenate two strings using jquery?

486


How can an element be checked if it contains a specific class?

397


What are the different types of selectors in jquery?

431


How can we show and hide an element via jquery?

462