简单教程
提交运行
代码编辑器:
<script> function displayResult(){ document.body.style.backgroundColor="#f3f3f3"; document.body.style.backgroundImage="url('/static/i/javascript/basic/img_tree.png')"; } </script> <h1>Hello World!</h1> <br> <button type="button" onclick="displayResult()">设置背景图片</button>
运行结果: