422: Creating addAttribute function

This commit is contained in:
metacryst
2023-12-27 14:55:13 -06:00
parent 07793dcd19
commit 41afb5a827

View File

@@ -1,6 +1,9 @@
HTMLElement.prototype.$ = function(query){
return this.querySelectorAll(query)
}
HTMLElement.prototype.addAttribute = function(name) {
this.setAttribute(name, "")
}
window.$ = function(selector) {
let query = document.querySelectorAll(selector);
if(selector[0] === "#") {