写一段JavaScript代码，当用户点击页面上的按钮时，它将显示“Hello World”。


无
Sure, here's a simple JavaScript code that displays "Hello World" when a user clicks on a button on the page:

```javascript
// first, select the button element from the page
const button = document.querySelector('button');

// add a click event listener to the button
button.addEventListener('click', () => {
  alert('Hello World');
});
```

When the user clicks the button, the `alert` function displays the message "Hello World" in an alert box.