Time remaining:
Javascript Help

Programming
Tutor: None Selected Time limit: 0 Hours

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>


Nov 30th, -0001
At least one public class is required in main file
Jul 6th, 2013

Studypool's Notebank makes it easy to buy and sell old notes, study guides, reviews, etc.
Click to visit
The Notebank
...
Nov 30th, -0001
...
Nov 30th, -0001
Dec 3rd, 2016
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