title: Bootstrap 4.2.1 - Failed to execute 'querySelector' on 'Document': 'javascript:void(0);' is not a valid selector
body: <p>I am working on a project which I started building on <strong>bootstrap 4.0.0</strong>. During this project, I had updated bootstrap regulary whenever the new versions ( 4.1.0  , 4.1.3 ) of bootstrap came and all the things were working perfectly until I have update to <strong>bootstrap 4.2.1</strong> from there I encountered error in console when ever I click on the document</p>
  
  <blockquote>
    <p>Uncaught DOMException: Failed to execute 'querySelector' on
    'Document': 'javascript:void(0);' is not a valid selector.</p>
  </blockquote>
  
  <p>I figured out that it occur due to the dropdown because of this error the dropdown does not work. I also checked, that if I am using <strong>href="javascript:void(0);"</strong>, <strong>href="#!"</strong> the error occur but if i use anchor tag without href or href="#" then it is working fine.</p>
  
  <p><strong>Note:-</strong> I need the solution with <strong>href="javascript:void(0);</strong> as <strong>href="#</strong> in the address link does not look pretty and page scrolls up to the top </p>
  
  <pre><code>&lt;div class="dropdown"&gt;
          &lt;a class="btn btn-secondary dropdown-toggle" href="javascript:void();" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"&gt;
              Dropdown link
          &lt;/a&gt;
  
          &lt;div class="dropdown-menu" aria-labelledby="dropdownMenuLink"&gt;
              &lt;a class="dropdown-item" href="#"&gt;Action&lt;/a&gt;
              &lt;a class="dropdown-item" href="#"&gt;Another action&lt;/a&gt;
              &lt;a class="dropdown-item" href="#"&gt;Something else here&lt;/a&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>Here is my <a href="https://codepen.io/anon/pen/wReoxa" rel="noreferrer">codepen</a></p>