I'm actually in a very weird situation and somehow can't be able to figure out what non-sense is happening to me. The situation is I'm actually implementing my bootstrap tooltip fine and I have checked it on the JsFiddle
, it is working fine there too, however, after a lot of efforts, it is not getting implemented on the web project, I don't know why.
This is literally very weird. Here is my implementation which is working fine on JsFiddle.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- jQuery Script -->
<script src="https://code.jquery.com/jquery-1.12.0.js"></script>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous">
<!-- Optional JavaScript -->
<!-- Popper.js, then Bootstrap JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js" integrity="sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js" integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm" crossorigin="anonymous"></script>
<script type="text/javascript">
$(document).ready(function (){
$("[data-toggle=tooltip]").tooltip()
})
</script>
</head>
<body>
<section class="testimonial home-page" id="home">
<div class="container">
<h1>Bringing ease to<br>each home</h1>
<button type="button" class="btn btn-secondary" data-toggle="tooltip" data-placement="bottom" title="Tooltip on bottom">
Tooltip on bottom
</button>
<div class="d-none d-sm-block" style="margin-top: 400px"></div>
</div>
</section>
</body>
And for the solutions I have done a lot of things but, unfortunately, all of them didn't work.
To take the class name into consideration
<script type="text/javascript"> $(document).ready(function (){ $(".btn-secondary").tooltip() }) </script>
To use the body element to target the data-toggle :
<script type="text/javascript"> $(document).ready(function (){ $("body").tooltip({ selector : '[data-toggle=tooltip]' }) }) </script>
To use the container as body and focus on the section :
<script type="text/javascript"> $(document).ready(function (){ $(".testimonial.home-page").tooltip({ selector : '[data-toggle=tooltip]', container : 'body' }) }) </script>
This is what I'm getting on my web project:
Don't take me wrong, I'm really confused about why it ain't happening since everything is fine. Any ideas would be appreciated, I'm a noob and I know that you guys can help me on this.
EDITS
I have checked the console and got this error saying the .tooltip is not a function: