<html> <head> <script type="text/javascript"> function changeSize() { document.getElementById("compman").height="250" document.getElementById("compman").width="300" } </script> </head> <body> <img id="compman" src="/images/example/compman.gif" width="107" height="98" /> <br /><br /> <input type="button" onclick="changeSize()" value="改变图片大小"> </body> </html>
编辑上面的文字,按下“查看结果”,效果会显示在右边 Create by 软晨网(RuanChen.com)