How to Create Simple Tooltip Using jQuery

This article explains how to create a simple tooltip using jQuery.

First we download the file and plug in a website; see:

  1. Query plugin 1.9

These files are added to the project or added directly by URL as in the following.

Program

Simple_Tooltip.html

 

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta charset="utf-8" />

<title>jQuery Tooltip</title>

<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css" />

<script src="http://code.jquery.com/jquery-1.8.2.js"></script>

<script src="http://code.jquery.com/ui/1.9.1/jquery-ui.js"></script>

<style type="text/css">

.ui-tooltip

{

font-size:10pt;

font-family:Verdana;

font-stretch:condensed;

font-style:italic;

color:blue;

}

</style>

<script type="text/javascript">

    $(function () {

        $(document).tooltip();

    });

</script>

</head>

<body>

<form id="form1" runat="server">

<table>

<tr><td colspan="2" align="center"><b>Employee Information</b></td></tr>

<tr>

<td>Name:</td>

<td><input id="Name" name="name" title="Please enter your name." /></td>

</tr>

<tr>

<td>Address:</td>

<td> <input id="address" name="address" title="Please enter your address." /></td>

</tr>

<tr>

<td>City:</td>

<td>  <input id="city" name="city" title="Please enter your city" /></td>

</tr>

</table>

 

</form>

</body>

</html>

 

Output 1

Hover the mouse over the textboxes:


 fig1.jpg


Output 2


 fig2.jpg


Output 3


 fig3.jpg


For more information, download the attached sample application. 

Up Next
    Ebook Download
    View all
    Learn
    View all