title: JQuery error: Uncaught Error: Syntax error, unrecognized expression
body: <p>I Have this script below that suppose to get values from input fields and then add them in a href link. but i keep getting this error in console:</p>
  
  <blockquote>
    <p>Uncaught Error: Syntax error, unrecognized expression:
    ?add-to-cart=7690&amp;variation_id=8498&amp;attribute_pa_color=gold</p>
  </blockquote>
  
  <p>Here is the script:       </p>
  
  <pre><code>    jQuery(document).on("click", ".variations_form.cart .variation_buttons_wrapper a", function(){
      // Get all the values needed for the URL
      var add_to_cart = jQuery(this).parent().parent().parent().parent().parent().parent().find( 'input[name="add-to-cart"]' ).val();
      var variation_id = jQuery(this).parent().parent().parent().parent().parent().parent().find( 'input[name="variation_id"]' ).val();    
      var pa_color = jQuery(this).attr("id");
      setTimeout(function(){
      // Craft the URL
      var link = jQuery("?add-to-cart=" + add_to_cart + "&amp;variation_id=" + variation_id + "&amp;attribute_pa_color=" + pa_color);
      alert(link);
      }, 500); 
     });
  </code></pre>
  
  <p>Any ideas??</p>