In the Bootstrap documentation page, the tooltip has a signature of:
hover over me
They've chosen to use data-toggle
as an indicator in their JavaScript for when something is a tooltip. When the tooltips JS file sees the data-toggle="tooltip"
attribute, it knows to kick in and run.
A more common approach might be to use a class (hover over me
), but they've gone data-*
attribute instead. Does the same thing, works, and philisophically, data-*
attributes were designed for JavaScript manipulation, so I suppose it's good to keep it class free.