JQuery Focus

 

In this example The focus() method triggers the focus event and it occur when textbox get focused.

 
 
 
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script> <script> $(document).ready(function(){ $("input").focus(function(){ $("span").css("display", "inline").fadeOut(3000); }); }); </script> <style> span { display: none; } </style> </head> <body> <h3>Enter text:-</h3><input type ="text"> <span style="color: mediumvioletred;font-size: 30px; font-family: 'Times New Roman', Times, serif">Learnkode will help you to be a great coder!</span> </body> </html>
Output