Jump to content

Is there A way to use JavaScript to add help bubbles?


teamcrunk
 Share

Recommended Posts

Is there a Way with Javascript to add Help bubbles over an input Box?For example when you you hover over an input for Name: _____ it would say like First Name????ThanksAn example is this https://edit.europe.yahoo.com/registration?.intl=ukWhen you go over the name field it says First name in a bubble. Ive been searching all over and can not find out how to do it.

Link to comment
Share on other sites

The 'title' attribute is definitely the easiest way to achieve what you're after. It will trigger the basic 'tooltip' behaviour of the browser. example:

  Name: <input type="text" title="First Name">

Of course there are several ways to make that prettier, using javascript, but this works prefectly adequately.

Link to comment
Share on other sites

To enhance it you can download JQuery UI, reference it and then put the following script onto your document

$(document).tooltip();

. You can then use the title attribute as above.

Link to comment
Share on other sites

Of course there are several ways to make that prettier, using javascript, but this works prefectly adequately.
You don't even need JavaScript. You can use pure CSS to make tooltips like that. Then they look pretty and work even if JS is disabled.
Link to comment
Share on other sites

You don't even need JavaScript. You can use pure CSS to make tooltips like that. Then they look pretty and work even if JS is disabled.
I guess it depends on whether you're going for correctness, or ease of use and the ability to make your website look the same across all browsers.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...