JSFiddle - React, Tailwind, and code Playground

by amitrdx

HTML

<link rel="stylesheet" href="http://ajax.aspnetcdn.com/ajax/jquery.mobile/1.1.0/jquery.mobile.structure-1.1.0.min.css">
<link rel="stylesheet" href="http://ajax.aspnetcdn.com/ajax/jquery.mobile/1.1.0/jquery.mobile.theme-1.1.0.min.css">
<link rel="stylesheet" href="http://ajax.aspnetcdn.com/ajax/jquery.mobile/1.1.0/jquery.mobile-1.1.0.min.css">
<script src="http://ajax.aspnetcdn.com/ajax/jquery.mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
<input type="text" id="text1">
<br/>
<input type="text" id="text2">
<input type="button" id="btn" value="compare">

JavaScript

var clickwithblur = false;

$("#btn").click(function() {
    alert("click")
}).mousedown(function() {
    clickwithblur = true;
})
$("#text1").blur(function() {
    alert("blur")
    if (clickwithblur) {
        $("#btn").click()
    }
})