title: tooltip.js popper.js usage example
body: <p>As not very proficient in javascript I don't understand the <a href="https://popper.js.org/tooltip-documentation.html" rel="noreferrer">tooltip.js</a> documentation at all. Why do the not include an example for people like me?</p>
  
  <p>Ho do I have to install this library in order to work correctly?</p>
  
  <ol>
  <li>I add <code>tooltip.js</code> to <code>webpack</code> (installed via npm)</li>
  <li>Then I do <code>import tooltip from 'tooltip.js';</code></li>
  <li>Then what?</li>
  </ol>
  
  <p>I tried to use the code from <a href="https://getbootstrap.com/docs/4.1/components/tooltips/" rel="noreferrer">boostrap</a> :</p>
  
  <pre><code>&lt;p data-toggle="tooltip" data-placement="top" title="Tooltip on top"&gt;
    Tooltip on top
  &lt;/p&gt;
  $(function () {
    $('[data-toggle="tooltip"]').tooltip()
  })
  </code></pre>
  
  <p>But I don't actually use bootstrap so the error is: TypeError: </p>
  
  <blockquote>
    <p>$(...).tooltip is not a function</p>
  </blockquote>
  
  <p>There is some example code on <a href="https://popper.js.org/tooltip-examples.html" rel="noreferrer">their example page</a> which doesn't really help:</p>
  
  <pre><code>new Tooltip(referenceElement, {
      placement: 'top', // or bottom, left, right, and variations
      title: "Top"
  });
  </code></pre>
  
  <p>What is <code>referenceElement</code> ? Is it the class of the element I whish to trigger? </p>
  
  <p>I imagine something like this:</p>
  
  <pre><code>&lt;p title="xyz" data-toggle="tooltip"&gt;hello&lt;/p&gt;
  </code></pre>
  
  <p>And then write the javascript somewhat like this???</p>
  
  <pre><code>new Tooltip('[data-toggle="tooltip"]', {
      placement: 'top',
      trigger: 'hover'
  });
  </code></pre>
  
  <p>That certainly does not work. It returns the error: </p>
  
  <blockquote>
    <p>TypeError: reference.addEventListener is not a function</p>
  </blockquote>
  
  <p>How? Why? A little Codepen: <a href="https://codepen.io/Sepp/pen/ZowqdM" rel="noreferrer">https://codepen.io/Sepp/pen/ZowqdM</a></p>