<p>验证码图片<img id='code1' border=1 src="./code.php?r=<?php echo rand(); ?>">
<a href="javascript:void(0)" onClick="document.getElementById('code1').str="./code.php?r="+Math.random()">看不清?</a>
</p>
onClick="document.getElementById('code1').str="./code.php?r="+Math.random()"中str写错了,应该src