JSFiddle - React, Tailwind, and code Playground

by mvasilkov

HTML

<div class="boobies">boobies</div>

JavaScript

function Stuff(things) {
    this.things = Array.prototype.slice.call(things, 0)
}

Stuff.prototype.click = function (fn) {
    this.things.forEach(function (thing) {
        thing.addEventListener('click', fn.bind(thing), false)
    })
}

function $(selector) {
    return new Stuff(document.getElementsByClassName(selector.substr(1)))
}


$('.boobies').click(function () {
    this.innerHTML += ' clicked'
})