convert nodelist to array

This commit is contained in:
Kyle Spearrin 2017-10-11 22:11:34 -04:00
parent 171c9f324d
commit 0656e732fe
1 changed files with 2 additions and 1 deletions

View File

@ -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;