my jquery button doesn't work when I click the first time
<p>I'm trying to use javascript and jquery to do some plotting, here is the code that I define the button, but the first time I click it doesn't work, the second time it works well, I don't understand why.</p>

<pre><code>$('&lt;p&gt;&lt;input type="button" value="Plot Data" /&gt;&lt;/p&gt;').click(getData).appendTo('#plot');
</code></pre>

<p>Could someone help to explain it?
Thanks!</p>

<p>Mengfei</p>
