Reputation: 1435
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.
Upvotes: 1
Views: 3489
Reputation: 4368
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>
Upvotes: 3
Reputation: 948
Remeber to inject all the dependency / packages needed for your application.
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js""></script>
Upvotes: -1