UNPKG

ajsfw

Version:
33 lines (32 loc) 1.03 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var HTMLCollectionOf = (function (_super) { __extends(HTMLCollectionOf, _super); function HTMLCollectionOf(arrayLength) { var _this = this; if (arrayLength) { _this = _super.call(this, arrayLength) || this; } else { _this = _super.call(this) || this; } return _this; } HTMLCollectionOf.prototype.item = function (index) { if (index < 0 || index > this.length - 1) { return null; } return this[index]; }; HTMLCollectionOf.prototype.namedItem = function (name) { for (var _i = 0, _a = this; _i < _a.length; _i++) { var e = _a[_i]; if (e.getAttribute("id") === name || e.getAttribute("name") === ("id")) { return e; } } return null; }; return HTMLCollectionOf; }(Array)); exports.default = HTMLCollectionOf;