1. Home
  2. Computing & Technology
  3. JavaScript
photo of Stephen Chapman
Stephen's JavaScript Blog

By Stephen Chapman, About.com Guide to JavaScript since 2004

Inline Tooltips

Friday July 11, 2008
JavaScript can update the information in the page to explain what your visitors don't understand

Some people prefer that additional details about a term or link on their web page be displayed inline after the link instead of hovering over the page in its own box. This JavaScript shows and hides the content of a span that follows immediately after the linked text.

Inline Tooltips
Comments
July 2, 2006 at 3:40 am
(1) keivan says:

I did what you mentioned for inline tooltip. I put the following code at ,

function toggleInline(t) {
var x = document.getElementById(t).style;
if (x.display == ‘inline’) x.display = ‘none’;
else x.display = ‘inline’;
return false;
}
.intip {font-style:italic;font-weight:bold;display:none;}

and the following code at
Hi!
WELCOME

But whenever I refresh my page, after I do mousout from the Hi! I see “Java Script Error: Object expected”

Was I wrong, please let me know.

– You didn’t set up the HTML correctly –

July 11, 2008 at 5:49 pm
(2) gary says:

Why do you need multiple ID’s?

One ID, one ccs class, and different href seems to work. Am I missing something?

July 11, 2008 at 6:30 pm
(3) Stephen says:

You need one id per tip. If you have five tips in the page then you need five ids and one class. The ids identify which tip you are updating.

July 12, 2008 at 4:42 pm
(4) gary says:

Thank you!

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

Explore JavaScript
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. JavaScript

©2009 About.com, a part of The New York Times Company.

All rights reserved.