JSFiddle - React, Tailwind, and code Playground
HTML
<body>
<div style="text-align:center;">
<input type="text" class="tb">
<p class="log">null</p>
</div>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
</body>
JavaScript
$(document).ready(function()
{
// work
// $(".tb").bind("mouseenter", function()
// {
// var counter = $(".log").html();
// $(".log").html("mouseenter");
// return false;
// });
// $(".tb").bind("click", function()
// {
// var counter = $(".log").html();
// $(".log").html("click");
// return false;
// });
// not work
$(".tb").bind("mouseenter", binding2("mouseenter"));
$(".tb").bind("click", binding2("click"));
});
function binding2(text)
{
var counter = $(".log").html();
$(".log").html("event: " + text);
return false;
}