Q:

Show tooltip using Javascript or jQuery on Span Tag

I want to show tool-tip on span tag.
<span class="test" href="#" data-toggle="tooltip" data-placement="top" title="Hooray!">*</span>

The jQuery Code That I have done
<script>
 $(document).ready(function(){
 $('[data-toggle="tooltip"]').tooltip();   
 });
</script>

But this is not running. Any Help appreciated in advance.

A:

Make sure you have loaded jquery and jquery-ui scripts:

$(document).ready(function(){
    $('[data-toggle="tooltip"]').tooltip();  
});
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<span class="test" href="#" data-toggle="tooltip" data-placement="top" title="Hooray!">* Hover</span>

