title: Syntax error, unrecognized expression: a[href=#]
body: <p>My WordPress theme creates a Javascript error:</p>
  
  <blockquote>
    <p>Error: Syntax error, unrecognized expression: a[href=#tab-container]</p>
  </blockquote>
  
  <p><a href="https://wordpress.org/support/topic/read-this-first-wordpress-45-master-list/" rel="nofollow noreferrer">https://wordpress.org/support/topic/read-this-first-wordpress-45-master-list/</a></p>
  
  <p>I know that the problem is the character <code>#</code> and I have to escape it but I don't know how. Here's my code:</p>
  
  <pre><code>&lt;ul class="tabs"&gt;
      &lt;li class="active"&gt;&lt;a href="#tab-container"&gt;&gt;News&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#tab2-container"&gt;Reviews&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <pre class="lang-js prettyprint-override"><code>$(".tabs li").click(function() {
      $(".tabs li").removeClass('active');
      $(this).addClass("active");
      $(".destination-tab").hide();
      var selected_tab = $(this).find('a').attr('href');
      $(selected_tab).fadeIn();
      return false;
  });
  </code></pre>
  
  <p>I hope someone can help me.</p>