<html> <head> <meta charset="utf-8"> <script src="https://code.jquery.com/jquery-1.12.4.js"></script> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> <link href="https://ajax.aspnetcdn.com/ajax/jquery.ui/1.12.1/themes/start/jquery-ui.css" rel="stylesheet"/> <script> $(function(){ //$("#NameID").tooltip();//shows only for tet field $(document).tooltip();// for all dom elements having title attribute shows tooltip widget //content option to display tooltip $("#NameID").tooltip({ //content: '<b>Content:</b>this will override the native title' content : getTooltip, // tooltip by calling function track : true, show:{delay:10, duration:500, effect:'explode'}, //millisesc hide: { delay:10, duration:100, effect:'slideDown'} }); }); function getTooltip(){ return 'tooltip from function' } </script> </head> <body> <form> <label title="Name">Name:</label> <input title="Name here" type="text" id="NameID" /> </form> </body> </html>
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more