When I'm spam clicking on the button it sometimes changes the number of decimals. Why?
<!doctype html>
<html>
<head>
</head>
<body>
<button onmouseover="showSomething()" onmouseout="hideSomething()" onclick="addSomething()">Show something</button>
<p id="show"></p>
<script>
function showSomething() {
x = Math.random()*100;
x = x.toFixed(2);
document.getElementById("show").innerHTML = x;
}
function hideSomething() {
document.getElementById("show").innerHTML = "";
}
function addSomething() {
x++;
document.getElementById("show").innerHTML = x;
}
</script>
</body>
</html>