Search and search switches are functional

This commit is contained in:
Claude Brisson
2023-12-17 19:42:16 +01:00
parent ea44f6068e
commit 98192a1ebc
13 changed files with 228 additions and 82 deletions

View File

@@ -113,6 +113,32 @@ NodeList.prototype.find = function(selector) {
});
return Reflect.construct(Array, result, NodeList);
}
Element.prototype.find = function (selector) {
Element.prototype.find = function(selector) {
return this.querySelectorAll(':scope ' + selector);
}
NodeList.prototype.clear = function() {
this.forEach(function (elem, i) {
elem.clear();
});
return this;
}
Element.prototype.clear = function() {
this.innerHTML = '';
return this;
}
/*
TODO - conflicts with from.val(), rename one of the two
NodeList.prototype.val = function(value) {
this.item(0).val(value);
}
Element.prototype.val = function(value) {
// TODO - check that "this" has the "value" property
if (typeof(value) === 'undefined') {
return this.value;
} else {
this.value = value;
}
}
*/