title: Syntax error, unrecognized expression for jquery class selector
body: <p>I am using jquery 1.11.1 with Flask/jinja2 templates</p>
  
  <p>While attempting to remove row based on class, I used</p>
  
  <pre><code>$("table#success tr[class=" + sale_id.rowclass  +"]").remove();
  </code></pre>
  
  <p>The "sale_id.rowclass" variable is passed in from my jinja template.
  When the variable is single valued(eg."n133") the statement works perfectly however
  when the variable holds a double value eg. "danger n133"</p>
  
  <p>I get:</p>
  
  <blockquote>
    <p>"Error: Syntax error, unrecognized expression: table#success
    tr[class=danger n133]"</p>
  </blockquote>
  
  <p>Any ideas on what I am doing wrong?</p>
  
  <h1>SOLVED:</h1>
  
  <p>Thanks all posters, I am new to jquery and javascript and you guys taught me a lot.</p>
  
  <p>To be able to delete a row containing class " danger n123" <strong>OR</strong> containing class "n123", I did the following.
  Thanks to Kevin Grabher and Grundy I got separate values from sale_id.rowclass by using the .split() function</p>
  
  <pre><code>var clsvalues = sale_id.rowclass.split(" ");
  </code></pre>
  
  <p>Then</p>
  
  <pre><code>$("table#success tr[class~='" + sale_id.rowclass + "'],[class~='" + clsvalues[1] + "']").remove();
  </code></pre>
  
  <p>The placement of quotes sent me crazy though. If there are more elegant solutions I would welcome it.</p>
  
  <p>To newbies like me the comma between the indexes allowed for an "or".
  <a href="https://stackoverflow.com/a/2263976/4154955">https://stackoverflow.com/a/2263976/4154955</a></p>