using inline event handlers is usually considered bad practice, as you are asking the browser to parse javascript events from html strings, a much better way would be as follows:
<html>
<head>
<script>
window.addEventListener("load",function(){
window.myButton = document.getElementById("myButton");
window.myButton.addEventListener("click",myButtonFunction);
});
function myButtonFunction()
{
alert('test');
}
</script>
</head>
<body>
<input id="myButton" type="button" value="Remove"/>
</body>
</html>
also you don't need to declare it as a window variable (global), unless you want to access it in your function. (but could also access it again via document.getElementById("myButton")