You need to take care about left toolbox option, where you want your script (in head/ domready etc).
This is working :
<body>
<div id="hola">
Hola.
</div>
<div>
<a onclick="changeMe()">Click here.</a>
</div>
</body>
function changeMe() {
document.getElementById("hola").innerHTML="Hello!";
}