<body>
<ul class="baidu">
<li><img src=" images/1. jpg"></li>
<li><img src= ”images/2. jpg"></li>
<li><img src=" images/3. jpg"></li>
<li><img src=”images/4. jpg"></li>
</ul>
<script>
var imgs = document . querySelector(' . baidu' ) . querySelectorall( ' img ' );
for (var i = 0; i < imgs.length; i++) {
imgs[i].onclick = function() {
document . body . style. backgroundImage = 'url(' + this.src + ')';
}
</script>
</body>