From the course: Bootstrap 4 Essential Training

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Add tooltips

Add tooltips - Bootstrap Tutorial

From the course: Bootstrap 4 Essential Training

Start my 1-month free trial

Add tooltips

- [Instructor] Tooltips are a great way to show some simple additional information on links and buttons. Now you should only use tooltips on HTML elements that are focusable like links and foreign controls because of problems with usability. In order to set these up, you add a data-toggle of tooltip to an element and then add a title attribute with some text in it. That text can optionally have some HTML and you use it inside a title tag like this. Tooltips are configured in one of two ways, you can use a data attribute or JavaScript. Data is a lot easier and it's what I'll be showing you here, however you can do anything that you can with the data attributes in JavaScript as well. Tooltips are not turned on by default so if you do want to use 'em, you will still need to use JavaScript, even if you're using data attributes. Now if you do want to configure them with JavaScript, you would use something like this. You would create sort of a regular jQuery call, which is what this is, and…

Contents