<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>test</title>
</head>
<body>
<button id="test" onclick="doit()">click</button>
<P id="num">4</P>
<script>
function doit() {
var value = document.getElementById("num").innerText;
document.write(value)
if (value > 3) {
document.getElementById("num").innerHTML= 50;
} else {
document.getElementById("num").innerHTML=590;
}
}
</script>
</body>
</html>
Why can"t the code after adding document.write (value); be executed?