422: Creating addAttribute function
This commit is contained in:
3
index.js
3
index.js
@@ -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] === "#") {
|
||||
|
||||
Reference in New Issue
Block a user