You have mentioned that the program is generating a new number but the number in "getal" stays the same. So, it means that the var getal gets assigned a value when you do var getal = newGetal(); I think that the problem is occurring because the page is remaining the same and not loading again. You can try the following code :
HTML Code:
<html lang="en">
<head>
<title>Test</title>
<script type="text/javascript">
function newGetal(){
var g = Math.random()*100;
g = Math.round(g);
return g;
}
var getal = newGetal();
</script>
</head>
<body>
<div id="testing"></div>
<a onclick="document.getElementById('testing').innerHTML = newGetal();return false;" href="#">Random Numbers</a>
</body>
</html>
Bookmarks