JavaScript可以改变html中的属性以改变《body》的颜色为例:
body id="bg">
<script>
function bfcolor(color){//有参方法
document.getElementById("bg").style.backgroundColor=color;}//获得该元素
</script>
<input type="button" onclick="bfcolor('#ff0000');" value="色彩"/><-改变颜色->
改变img中的图片
<script>
function shif(t){
document.getElementById("ss").src=t;}
</script>
<img id="ss" src="1.jpg" width="100" height="100px" />//原图片1.jpg
<input type="button" onclick="shif('2.jpg')" value="替换" />//替换后的图片2.jpg