ded/qwery — Issue #65: Using an html form element as a root doesn't work
Author: benekastah
Created: 2011-12-13 06:58:13+00:00
State: open

If I do this:

```javascript
$('form').each(function () {
var form = this,
submit = $('button[type=submit]', form);
submit.click(function () {
// do stuff
});
});
```

It doesn't work. The problem is that (at least in Chrome) html form elements have a length. Therefore, when qwery is trying to determine the root element, it looks at the form element as a qwery selector and returns `form[0]`, which in this case turns out to be an input element of the form. The temporary way around this is to wrap the bare html form element in a qwery

```javascript
// instead of
var form = this;
// do
var form = $(this);
```