Time remaining:
Javascript Help

label Programming
account_circle Unassigned
schedule 0 Hours
account_balance_wallet $5

I am having trouble with the code below because I am trying to call the text field input type so that whenever someone enters a number above 10 it responds with the alert shown below, but I am having a problem because whenever I input a number greater than 10 in the text field it still replies with "the number is less than 10"??? What am I doing wrong? FYI I am a beginner javascript learner 

<script>

//Variables

var txtInput = document.getElementById('txtInput');

//Functions

function submitNum()

{

if (txtInput <= 10)

{

alert("The number is less than 10");

}

else

{

alert("The number is greater than 10");

}

}

</script>

</head>

<body>

<input type="text" placeholder="Type any number" id="txtInput" /><input type="button" onclick="submitNum()" value="Submit" />

</body>

</html>


Oct 20th, 2017
At least one public class is required in main file
Jul 6th, 2013

Did you know? You can earn $20 for every friend you invite to Studypool!
Click here to
Refer a Friend
...
Oct 20th, 2017
...
Oct 20th, 2017
Oct 21st, 2017
check_circle
Mark as Final Answer
check_circle
Unmark as Final Answer
check_circle
Final Answer

Secure Information

Content will be erased after question is completed.

check_circle
Final Answer