JSFiddle - React, Tailwind, and code Playground
HTML
<!-- confirmat of the old passsword and new password-->
<input type="text" id="oldPassword" />
<input type="text" id="newPassword" />
<input type="Submit" id="btnSubmit" value="Submit" />
JavaScript
$("#newPassword").focusout(function () {
var val1 = $("#oldPassword").val();
var val2 = $("#newPassword").val();
if (val1 == val2) {
alert("old password and new password are same");
}
});