jquery assign onclick for li from a link
<p>I have a list of items</p>

<pre><code>&lt;ul class="list"&gt;
    &lt;li&gt;
        &lt;a href="#Course1" class="launch" onclick="alert('event 1')"&gt;event 1&lt;/a&gt;
    &lt;/li&gt;
    &lt;li class="alt"&gt;
        &lt;a href="#Course2" class="launch" onclick="alert('event 2')"&gt;event 2&lt;/a&gt;
    &lt;/li&gt;
    &lt;li&gt;
        &lt;a href="#Course3" class="launch" onclick="alert('event 3')"&gt;event 3&lt;/a&gt;
    &lt;/li&gt;
    &lt;li class="alt"&gt;
        &lt;a href="#Course4" class="launch" onclick="alert('event 4')"&gt;event 4&lt;/a&gt;
    &lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>I want to be able to assign the onclick of the link to the onclick of the li aswell</p>

<p>My attempt so far is one click behind (as I am assigning the script to the onclick rather than executing the script)</p>

<pre><code>$('.list li').click(function() {
    var launch = $('a.launch', this);
    if (launch.size() &gt; 0) { this.onclick = launch.attr('onclick'); }
});
</code></pre>

<p>Thanks in advance 
Tim</p>
