JSFiddle - React, Tailwind, and code Playground

by Nick Craver

HTML

<p id="menu">
    <a href="#">One</a>
    <a href="#">Two</a>
    <a href="#">Three</a>
</p>

JavaScript

var MyObject = {
    init: function () {
        this.items = $('#menu a');
        this.items.bind('click', this.doSomething);
    },

    doSomething: function () {
        alert(this.innerHTML);
    }
};

MyObject.init();