Bootstrap Question:

Download Job Interview Questions and Answers PDF

Please consider the HTML code snippet below.

<button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="top" title="My Title">Hover over me</button>

What is missing for a tooltip to show properly?

Bootstrap Interview Question
Bootstrap Interview Question

Answer:

Bootstrap’s Tooltip plugin is not CSS-only, like other plugins are. For performance reasons, the Tooltip plugin is opt-in, and to use it you must initialize it using JavaScript with the following example code:

$(function () {
$('[data-toggle="tooltip"]').tooltip();
});

Download Bootstrap Interview Questions And Answers PDF

Previous QuestionNext Question
Tell me what is the difference between the following two lines of code?

$('#myModalPrompt').modal({ keyboard: false });
$.fn.modal.Constructor.DEFAULTS.keyboard = false;?
Tell me what is Modal plugin used for in Bootstrap?