I am trying to clear fields after submit. I have tried everything I seen on google search nothing is working
<input type="text" id="a1">
<input type="button" class="button" value="Submit" onclick="w001()">
<span id="a21"></span>
</form>
function w001() {
var a = document.getElementById("1");
if ((a.value == "a 7") || (a.value == "7")) {
document.getElementById('a21').innerHTML = 'correct';
} else {
document.getElementById('a21').innerHTML = 'incorrect';
}
`function w001Field() {
if (document.getElementById) {
document.a1.value = "";
}
}
`}