JSFiddle - React, Tailwind, and code Playground

by ericf

HTML

<script src="http://yui.yahooapis.com/3.5.0pr4/build/yui/yui-min.js"></script>
<div id="test"></div>

CSS

.over {
    color: green;
}

JavaScript

YUI().use('view', function (Y) {

    var view = new Y.View({
        container: '#test',
        
        events: {
            '#test': {
                mouseover: 'onMouseOver',
                mouseout : 'onMouseOut'
            }
        }
    });
    
    view.render = function () {
        this.get('container').setContent('<p>Some text</p>');
        return this;
    };
    
    view.onMouseOver = function (e) {
        this.get('container').addClass('over');
    };
        
    view.onMouseOut = function (e) {
        this.get('container').removeClass('over');
    };
    
    view.render();

});