convert nodelist to array
This commit is contained in:
parent
171c9f324d
commit
0656e732fe
|
@ -551,8 +551,9 @@
|
||||||
function getFormElements(theDoc, limit) {
|
function getFormElements(theDoc, limit) {
|
||||||
var els = [];
|
var els = [];
|
||||||
try {
|
try {
|
||||||
els = theDoc.querySelectorAll('input:not([type="hidden"]):not([type="submit"]):not([type="reset"])' +
|
var elsList = theDoc.querySelectorAll('input:not([type="hidden"]):not([type="submit"]):not([type="reset"])' +
|
||||||
':not([type="button"]):not([type="image"]):not([type="file"]), select');
|
':not([type="button"]):not([type="image"]):not([type="file"]), select');
|
||||||
|
els = Array.prototype.slice.call(elsList);
|
||||||
} catch (e) { }
|
} catch (e) { }
|
||||||
|
|
||||||
return limit && els.length > limit ? els.slice(0, limit) : els;
|
return limit && els.length > limit ? els.slice(0, limit) : els;
|
||||||
|
|
Loading…
Reference in New Issue