title: addClass to a certain id after ajax response with json
body: <p>I want to apply the class by <code>addClass</code> to an element with specific <code>id</code>. Which is return by ajax in a <code>json</code> format.</p>
  
  <p><strong>js</strong></p>
  
  <pre><code>$(document).on('blur', '.autosave', function(e) { 
      e.preventDefault();
    $.ajax({
      type: 'POST',
      url: 'inc/products_autosave.php',
      data: {
          id: $(this).prop('id'),
          val: $(this).val()
      },
      dataType:'json',
      success: function(resp) {
          console.log(resp); //debug
          if(resp.sql=='ok'){
              $('#'+resp.id).addClass('has-success animate bounce');
              alert(resp.sql+' - '+id);
          }else{
              alert(resp.sql+' - '+id);
          }
      }
    });
  });
  </code></pre>
  
  <p><strong>json</strong></p>
  
  <pre><code>{sql: "ok", id: "prd_title_en|3"}
  </code></pre>
  
  <p><strong>html</strong></p>
  
  <pre><code>&lt;tr id="3"&gt;
      &lt;td&gt;00003&lt;/td&gt;
      &lt;td&gt;&lt;input type="text" name="prd_cde" id="prd_cde|3" class="form-control autosave" value="3000002" /&gt;&lt;/td&gt;
      &lt;td&gt;&lt;input type="text" name="prd_title_en" id="prd_title_en|3" class="form-control autosave" value="FULL DAY CITY TOUR WITH LUNCH (6 PERSON)" /&gt;&lt;/td&gt;
      &lt;td&gt;&lt;input type="text" name="prd_title_th" id="prd_title_th|3" class="form-control autosave" value="xxx" /&gt;&lt;/td&gt;
      &lt;td&gt;&lt;input type="number" name="prd_cost" id="prd_cost|3" class="form-control autosave" value="900" /&gt;&lt;/td&gt;
      &lt;td&gt;&lt;input type="checkbox" class="autosave" name="prd_rcm" id="prd_rcm|3" value="1" data-toggle="toggle" data-size="mini" data-onstyle="success" data-on="Yes" data-off="No"/&gt;&lt;/td&gt;
      &lt;/tr&gt;
  </code></pre>
  
  <p>Ideally, I want to add class <code>has-success</code>, <code>animate</code> and <code>bounce</code> to the input <code>#prd_title_en|3</code>. But it keep saying <code>Uncaught Error: Syntax error, unrecognized expression: #prd_title_en|3</code></p>