You did everything right, works on my machine, with exactly this text, which I think is exactly what you show in your image:
var btn = document.createElement("button");
btn.innerHTML = "Click Me";
document.body.appendChild(btn);
Things to check for you:
- is it really failing to add the button, or is it just tucked away in a corner somewhere. In your browser open the inspector (F12) and search for “Click Me”. See if you find it;
- is the javascript failing? In the inspector, check the console for errors;
- is the javascript triggering at all? Add a alert as first line;