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 multipl开发者_开发技巧e selector. should we move the dialogDiv inside the quote? "$('form, dialogDiv')"
The second parameter of jQuery's selector is context
$('form', dialogDiv)
is the same as $(dialogDiv).find('form')
;
Its looking for a form
inside divDialog
which appears to be empty.
It is the equivalent of $(dialogFiv).find('form')
.
精彩评论