JSFiddle - React, Tailwind, and code Playground
HTML
<script type="text/javascript" src="https://getfirebug.com/firebug-lite-debug.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js"></script>
<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/themes/redmond/jquery-ui.css" rel="stylesheet" />
<button id="hover">Hover me!</button>
<button id="clear">clear</button>
<div id="msg"></div>
JavaScript
$("#hover").button({
icons: {
primary: "ui-icon-tag"
}
}).hover(function (event) {
// hover in
// Sometimes the event is caught by HTMLSpanElement instead of HTMLButtonElement and caused undesired result.. why?
$(this).button("option", "icons", { primary: "ui-icon-tag", secondary: "ui-icon-close" });
prependMessage(event.type + ' target: ' + event.target);
}, function (event) {
// hover out
$(this).button("option", "icons", { primary: "ui-icon-tag" });
prependMessage(event.type + ' target: ' + event.target);
});
function prependMessage(text)
{
$('#msg span').removeClass("red");
$('#msg').prepend("<span>" + text + " </span><br />");
$('#msg span:first').addClass("red");
}
$('#clear').click(function(){
$('#msg').html('');
});