js 设置网页背景该如何做

img

img


这个color的函数是什么?


<script>
    var red = 'red';
    var green = 'green';
    var yellow = 'yellow';

    document.getElementById('b').onclick = function () {
        color(yellow)
    };

    function color(yanse) {
        document.body.style.backgroundColor = yanse;
    }
</script>

function(color){
document.body.style.backgroundColor=color
}