Javascript, passing a variable into a click event?
<p>I really can't figure out how I would do this. It's more of a concept question than a code question so I'll just post an example:</p>

<pre><code>object = $('#div');

function doSomething(object) {
    //iterates through a list and creates a UL with items in corresponding to that list.
    $(body).append("&lt;li id='clickme'&gt;Hello world&lt;/li&gt;");
}

function createModal(object) {
    //creates modal dialogue.
    doSomething(object);
    //more stuff
}

$('#clickme').live("click", function() {
    //I need access to object (not the object declared at first,
    //the object passed into doSomething) here.

});
</code></pre>

<p>Any ideas how I would do such a thing? doSomething would create a set of LIs and have a parameter passed into it. When those LIs the function creates are clicked, they need to interact with the parameter that's passed into doSomething. Is there a way to bind them or something?</p>

<p>Sorry if I didn't make any sense.</p>
