In Jquery, can I store the object reference and use it later?
<p>I got a problem with Jquery, I'm making a dynamic form on RoR, so I have a button next to an input that call to an jQuery modal. There the user would do a lookup and select some information from a list. </p>

<p>The problem is that I need to insert back the information in the input next to the button that the user click. So i was wondering there's any way to store the button dom and then reuse it so set the value on the input when the modal is getting hidden? Or there's other ways to solve this?</p>

<p>Function called on click over the button.</p>

<pre><code>function openPicker(event)
{   
    $('#myModal').modal('toggle')
}
</code></pre>

<p>Function called when the modal it's getting hidden.</p>

<pre><code>$('#myModal').on('hidden', function () {

})
</code></pre>

<p>Any help will be appreciated!</p>
