title: SyntaxError: '#companySize option:selected' is not a valid selector
body: <p>I have the following HTML and jQuery code.</p>
  
  <p>It shows me an error <code>"SyntaxError: '#companySize option:selected' is not a valid selector"</code> while I have <strong>opened the developer console of the browser (i.e. while I do Inspect Element)</strong> and crash my system. How can I solve it?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var customerSegment = $("#companySize option:selected").val();
  console.log(customerSegment);</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;select id="companySize"&gt;
   &lt;option value="0"&gt;Select Customer Segment&lt;/option&gt;
   &lt;option value="1"&gt; 1 - 100 &lt;/option&gt;
   &lt;option value="2"&gt; 100 - 200 &lt;/option&gt;
   &lt;option value="3"&gt; 200 - 300 &lt;/option&gt;
   &lt;option value="4"&gt; 300 - above&lt;/option&gt;
  &lt;/select&gt;</code></pre>
  </div>
  </div>
  </p>