How to use JQuery to inject a variable into a javascript function's parameters?
<p>Here's my  tag:</p>

<pre><code>&lt;div class="ContentBlock"&gt;
    &lt;a href="javascript:setActiveCookie('12345',7)"&gt;&lt;img src="/images/blah.gif"&gt;&lt;/a&gt;
&lt;/div&gt;
</code></pre>

<p>Rather than hard-coding that value of '12345', I'd like to edit this dynamically from a javascript function and inject a variable parameter there instead.</p>

<p>Any ideas how to do this?</p>

<p>Here's some JQuery where I'd like to do this.  Basically, I am building 10 dynamic rows, each will have the above  tag and each needs to use its own "ID" as a parameter in that 's call to 'setActiveCookie'.  (The ID is used to set a cookie value, FWIW).  Below, I've got a CLONE and have already swapped JSON stringify'd values into the dynamically-generated HTML.   I just need to inject this ID into the  function call.  Any help is appreciated!!</p>

<pre><code>$.each( val, function( key2, value ) {
    ///inject key2 and value into already-cloned JS object here.  This already is working.
    if ( key2 == 'storeId' ) {
        var ID = ( JSON.stringify( value ) );
        ///Shove this ID into the &lt;a&gt; tag here???
    }
} );
</code></pre>
