strange behavior on display|display:none elements
<p>I have a custom modal dialogue that consists of a simple div and some css. There are 2 buttons (OK, CANCEL) buttons. The CANCEL button is always the same; it hides the modal dialogue via <code>onclick="$('#div').css('display','none')"</code> (NB: this is also how the modal is shown; <code>('display','')</code>). I assign different actions to the OK button depending on the need. This is done via <code>$('#okBTN').attr('onclick','my_function()')</code>.</p>

<p><em>It works, but only the first time</em> &copy;  </p>

<p>The first time I open the modal and walk through the steps, everything works as expected. If I close the modal, however, then re-open it, the OK button has <strong>no</strong> action on it. I mean, the onclick is assigned (correctly); it's in the source code, and it will alert correctly via <code>.attr('onclick')</code>, but clicking the button does nothing. I have it set that when the modal pops up, the <code>onclick</code> is assigned each time; but it's almost as if there is a shadow copy or something stuck in memory or the DOM. Although, I don't see anything strange in Firebug....</p>

<p>I've tried cloning the button, reassigning it, then <code>replaceWith</code>'ing. I've also tried <code>remove</code>'ing it and re-adding it...</p>

<p>Any clues?</p>
