Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Executing a Function on Blur Event in jQuery</title> <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script> <style> label{ display: block; margin: 5px 0; } label span{ display: none; } </style> <script> $(document).ready(function(){ $("input").blur(function(){ $(this).next("span").show().fadeOut("slow"); }); }); </script> </head> <body> <form> <label>Email: <input type="text"> <span>blur fire</span></label> <label>Password: <input type="password"> <span>blur fire</span></label> <label><input type="submit" value="Sign In"> <span>blur fire</span></label> </form> <p><strong>Note:</strong> Click away from the form control or press the "Tab" key to remove focus.</p> </body> </html>