I want to create a function called with a single parameter that will accept any valid CSS selector by using the querySelectorAll method.
The function should return two methods to mimic the .css and .html from jq.
I'm pulling my hair out with this one. Can anyone help? This is all I have come up with so far and can't get figure it out:
const $ = (selector) => {
let element = document.querySelectorAll(selector);
return {
html: function(content) {
element.innerHTML = content;
}
}
};