JSFiddle - React, Tailwind, and code Playground

HTML

<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<input type="button" id="button" value="Say hello">

JavaScript

function test ()
{
    var self = this;
    this.message = "hello";
    this.on_change = function (){
        alert(self.message);
    }

    this.on_change();
}

$(document).ready(function() {
    var my_object = new test();
    $('#button').click(my_object.on_change);
});