title: How to use same funtion for 2 different variable
body: <p>Have to use same function with two different variable with querySelector attached to the variable. Following is the javascript.</p>
  <pre><code>var productLink = document.querySelector('.products-link');
  var productOffcanvas = document.getElementById('offcanvasProducts')
  
  productOffcanvas.addEventListener('show.bs.offcanvas', function () {
      element.classList.toggle('active');
  })
  productOffcanvas.addEventListener('hide.bs.offcanvas', function () {
      productLink.classList.toggle('active');
  })
  
  
  var solutionsLink = document.querySelector('.solutions-link');
  var solutionsOffcanvas = document.getElementById('offcanvasSolutions')
  
  solutionsOffcanvas.addEventListener('show.bs.offcanvas', function () {
      solutionsLink.classList.toggle('active');
  })
  solutionsOffcanvas.addEventListener('hide.bs.offcanvas', function () {
      solutionsLink.classList.toggle('active');
  })
  </code></pre>