Can I depend on the title attribute displayed as a tooltip?

We programmed simple tips on our website for a while and just realized that we could do the same thing just by using the title attribute. Any reason we shouldn't use the title attribute as a tooltip? Are there any browsers that do not support this feature? ( w3schools seems to indicate that all major browsers support this.)

+5
source share
5 answers

This is the standard; you must be safe.

See http://www.w3.org/TR/html4/struct/global.html#h-7.4.3

+2

, title. , alt, ( ) (, , ).

0

(1 2 Chrome), , - , .

( ) jQuery "mouseenter" "mouseleave". -, : HTML:

<button id="button-awesome">Awesome</button>

<div class="tooltip" style="display:none">
This is a button
</div>
Hide result

JavaScript/JQuery:

$('#button-awesome').on('mouseenter', function () {
  show Tooltip // toggle, or slideToggle, or .css("display","block") or .removeClass('hidden')
}).on('mouseleave', function () {
  // undo what you've just done. 
});
Hide result
0

, . .

0

All Articles