PHP and jQuery function—only works once?
<p>I have the following function. When I click the first time, it returns a random number, but all subsequent clicks always return the same number. How come it doesn't refresh?</p>

<pre><code>&lt;script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript"&gt;
    $(document).ready(function() {

        $('#btn-get-random-image').click(function () {

            $('#my-img').attr('src', '&lt;?php echo $pics[array_rand($pics, 1)]; ?&gt;');

        });
}); 
&lt;/script&gt;
</code></pre>
