JQuery ui $ ([])

It is just fast (I hope).

I was recently in the jquery ui dialog box to look at using the form inside the http://jqueryui.com/dialog/#modal-form dialog box , and I noticed some code that I hadn't seen before:

var allFields = $([]).add(#input1).add(input2).add(input3)....

I'm just wondering what $ ([]) means

At first I thought it was a way to create an array in jquery, but when I try:

allFields.add(input4)

nothing is added after the variable declaration?!?

Any help would be greatly appreciated! :) I tried using this on Google, but I had no luck.

+5
source share
2 answers

jQuery() , DOM. jQuery, . , jQuery, .

.add() .

$([]) jQuery, , .add('#input1') id of input1. .add('#input1') , .

+4
var allFields = $([]);
allFields.add()

.add()

0

All Articles