Display a message when the focus is removed from an element.
Note: Here object is similar to an Array of DOM Elements. using jquery
HTML Code :
<!DOCTYPE html> <html> <head> <script src="https://code.jquery.com/jquery-git.js"></script> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>Display a message when the focus is removed from an element.</title> </head> <body> <form> <input id="target" type="text" value="Field 1"> <input type="text" value="Field 2"> </form> <p>Set and remove focus from field1 </p> </body> </html>
JavaScript Code :
$( "#target" ).blur(function() { console.log( "Remove focus from fields1!" ); });
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
HTML Code :
JavaScript Code :