Html代码 <html> <head> <script> function test(){ document.getElementById('img').src="xxx1.jpg?v="+new Data(); //这里在ie浏览器下,可能会有缓存,所以加入时间参数,来防止缓存,在firefox,ie下都测试通过 } </script> </head> <body> <img src="xxx.jpg" id="img" onclick="test()"> <body> </html>