首页
极刻
圈子
教程
开源
极客社区
写文章
发极刻
建圈子
发项目
登录 / 注册
返回教程:Javascript 教程
TRY RUN / 在线示例
Javascript 教程 改变image的高度和宽度
Javascript 教程 改变image的高度和宽度
源代码
运行
<!DOCTYPE html> <html> <head> <script> function changeSize() { document.getElementById("compman").height="250"; document.getElementById("compman").width="300"; } </script> </head> <body> <img id="compman" src="/statics/images/w3c/eg_compman.gif" width="107" height="98"> <br><br> <input type="button" onclick="changeSize()" value="Change size of image"> </body> </html>
运行结果