I've been trying to use for loop via user input but for some reason it neither shows the error nor shows the output. here is my code below:-
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>js recap</title>
</head>
<body>
<form class="addform">
<input type="number" name="text" id="text">
</form>
<!-- START JAVASCRIPT -->
<script>
const addform = document.querySelector('.addform');
addform.addEventListener('submit', e => {
const todos = addform.text.value.trim();
e.preventDefault();
if (todos === typeof Number) {
for (let i = 0; i <= todos; i++) {
console.log(i);
}
}
});
</script>
<!-- END JAVASCRIPT-->
</body>
</html>