I'm trying to hide a form after some input has been given, but when I use the .style.display = "none"; command, all that happens is clear the boxes.
Here is the context that I have, the JS is at the bottom. Thanks!
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<form class = "input">
<label for = "name" required>Please enter your name</label>
<input type="text" id="name"><br><br>
<label for = "age" required>Please enter your age</label>
<input type="text" id="age"><br><br>
<label for = "colour">Please select a colour: </label>
<select id="colour" required>
<option value="Yellow">Yellow</option>
<option value="Blue">Blue</option>
<option value="Red">Red</option>
<option value="Green">Green</option>
</select><br><br>
<label for="">Select your difficulty:</label>
<select id="difficulty">
<option value = "1">1. Easy</option>
<option value = "2">2. Medium</option>
<option value = "3">3. Hard</option>
</select>
<br><br>
<input type="submit" onclick="clearScreen()">
</form>
<script>
function clearScreen() {
var x = document.getElementsByID("input");
x.style.display = none;
}
</script>
</body>
</html>