qinking126
qinking126

Reputation: 11875

please help me understand this jQuery selector

var dialogDiv = $('<div style="display:none;"></div>').appendTo('body');

$.validator.unobtrusive.parse($('form', dialogDiv));

"$('form', dialogDiv)", I know this should be jquery selector . but if this is multiple selector. should we move the dialogDiv inside the quote? "$('form, dialogDiv')"

Upvotes: 0

Views: 51

Answers (3)

Tgr
Tgr

Reputation: 28160

It is the equivalent of $(dialogFiv).find('form').

Upvotes: 1

Maxim Krizhanovsky
Maxim Krizhanovsky

Reputation: 26699

The second parameter of jQuery's selector is context $('form', dialogDiv) is the same as $(dialogDiv).find('form');

Upvotes: 2

Daniel A. White
Daniel A. White

Reputation: 190907

Its looking for a form inside divDialog which appears to be empty.

Upvotes: 2

Related Questions