How can I correct this code using javascript and html. Thanks in advance! please help me out of this problem.
<input type="text" id="text1">
<input type="text" id="text2">
<input type="submit" onclick="submit()">
<script type="text/javascript">
function submit() {
var q = document.getElementById('text1');
var w = document.getElementById('text2');
if (q > w) {
console.log('q is greaterthan in w');
} else{
console.log('q is less that in w');
}
}
</script>