title: jQuery - Find and scroll to an element dynamically based on its text content
body: <p>I'm building a 'jargon buster' which has a list of jargon terms at the top, and below that is an individual div for each of those terms, containing the term as a title, and its explanation underneath. </p>
  
  <p>I'm trying to write a function which, when you click on one of those jargon terms at the top, finds the div with that term as an h3 title, and scrolls to it.</p>
  
  <p>I don't know what these terms will be in advance so can't rely on hard coding. It's also possible that some terms may actually contain all of the letters from another term - for example, one term may be 'intellectual property' and another could be 'intellectual property lawyer'. So the function needs to find an exact match.</p>
  
  <p>So far, I've managed to write a function which converts to lower case and matches the clicked term up with the h3 of the same name. What I can't work out is how to use that to scroll to it. Does anyone have any suggestions? I could well be going at this completely the wrong way.</p>
  
  <p><strong>Example list of jargon terms:</strong></p>
  
  <pre><code>&lt;div class="jargonBusterDropDown"&gt;
      &lt;div class="textWrapper"&gt;
          &lt;p&gt;attorney&lt;/p&gt;
          &lt;p&gt;copyright&lt;/p&gt;
          &lt;p&gt;chartered&lt;/p&gt;
          &lt;p&gt;intellectual property&lt;/p&gt;
          &lt;p&gt;intellectual property lawyer&lt;/p&gt;
          &lt;p&gt;licensing&lt;/p&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>Example of a full jargon term div</strong></p>
  
  <pre><code>        &lt;div class="fullWidthContentCard jargonBusterCard"&gt;
              &lt;div class="fullWidthContentCard__title"&gt;
                  &lt;h3&gt;Attorney &lt;i class="fa fa-chevron-down" aria-hidden="true"&gt;&lt;/i&gt;&lt;/h3&gt;
              &lt;/div&gt;
              &lt;div class="fullWidthContentCard__content"&gt;
                  &lt;p&gt;DESCRIPTION GOES HERE&lt;/p&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p><strong>My JS</strong></p>
  
  <pre><code>$('.jargonBusterDropDown p').click(function(){
      var val = $(this).text().toLowerCase();
      var titles = [];
      $('.fullWidthContentCard__title h3').each(function(i, e){
          titles.push($(e).text().slice(0, -1).toLowerCase());
      });
      var elementToScrollTo = titles.filter(function(title){
          return val === title;
      });
      elementToScrollTo = elementToScrollTo.toString();
  });
  </code></pre>