[jQuery] $(form.elements) fails in Safari

[jQuery] $(form.elements) fails in Safari

> I added a test for a[0] == undefined instead of checking