title: Make AJAX call from <a href> click using attribute as a variable
body: <p>I have a link </p>
  
  <pre><code>&lt;a id="container" value="{$variable}" href="#"&gt;Click This&lt;/a&gt;
  </code></pre>
  
  <p>That I would like to use to POST via an AJAX call. </p>
  
  <p>Here is my code.</p>
  
  <pre><code>$('#container').click(function(event){
     event.preventDefault();
     $.post('/cart.php?mode=add&amp;productid={$variablegoes here}&amp;amount=1&amp;redirect_from_cart=Y', function(response){
        alert(response);
     });
  });
  </code></pre>