Hi I'm trying to use the function setTimeout() in javascript except it's not working. Thanks in advance to anyone who can help.
<!DOCTPYE html>
<html>
<head>
<script>
var button = document.getElementById("reactionTester");
var start = document.getElementById("start");
function init() {
var startInterval/*in milliseconds*/ = Math.floor(Math.random() * 30) * 1000;
setTimeout(startTimer(), startInterval);
}
function startTimer() {
document.write("hey");
}
</script>
</head>
<body>
<form id="form">
<input type="button id=" reactionTester" onclick="stopTimer()">
<input type="button" value="start" id="start" onclick="init()">
</form>
</body>
</html>