How can the script be modified to ensure compatibility with Internet Explorer?

The issue with compatibility with Internet Explorer is likely due to the use of modern JavaScript features that are not supported by the browser. To solve this, you can modify the script to use older, more widely supported JavaScript syntax and features that are compatible with Internet Explorer.

<script>
// Use older JavaScript syntax and features for compatibility with Internet Explorer
var button = document.getElementById('myButton');
button.onclick = function() {
  alert('Hello, World!');
};
</script>