top button
Flag Notify
Site Registration

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

+4 votes
555 views
What is the difference between $('div') and $('<div/>') in jQuery?
posted Jul 9, 2015 by Manikandan J

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

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

answer Jul 9, 2015 by Shivaranjini
...