0

I'm working with Bootstrap 4.6 and I want to change the function in my script to pure javascript. I don't want to use jQuery because my complete code is written in pure javascript.

How I'm able to solve this?

Thanks in advance!

<body>
  <div class="container">
    <h3>Tooltip Example</h3>
    <input data-toggle="tooltip" title="Hooray!">
    <input data-toggle="tooltip" title="Not Hooray!">
  </div>

  <script>
    $(document).ready(function(){
      $('[data-toggle="tooltip"]').tooltip();   
    });
  </script>
  </body>
</html>
patrick96
  • 175
  • 2
  • 14
  • You need to study their jquery plugin then traslate it into pure js. – Simone Rossaini Nov 09 '21 at 09:35
  • Does this answer your question? [How to initialize Tooltips in Bootstrap 4 with pure JavaScript? No jQuery](https://stackoverflow.com/questions/61039512/how-to-initialize-tooltips-in-bootstrap-4-with-pure-javascript-no-jquery) – Fabian S. Nov 09 '21 at 09:35
  • That's no problem. You seem to know how to write code that does not rely on jQuery, just re-implement jquery-tooltip from scratch and you're good. – Tomalak Nov 09 '21 at 09:36
  • See https://github.com/twbs/bootstrap/blob/v4.6.1/js/dist/tooltip.js for the source of bootstraps tooltip component. – Fabian S. Nov 09 '21 at 09:37
  • https://stackoverflow.com/questions/18359193/plain-javascript-tooltip here is already answer of your question – Neeraj Nov 09 '21 at 09:57

0 Answers0