Rain Lover
07-11-2014, 07:40 AM
Here's the code:
<input type="number" value="0" id="input">
<script>
if (document.getElementById('input').value == 0) {
alert('Hello, world!');
}
</script>
DEMO (http://jsfiddle.net/Mori/9hwTb/)
And here's the JSLint error:
Expected '===' and instead saw '=='.
But when I listen to the advice and change == to ===, the alert stops appearing.
<input type="number" value="0" id="input">
<script>
if (document.getElementById('input').value == 0) {
alert('Hello, world!');
}
</script>
DEMO (http://jsfiddle.net/Mori/9hwTb/)
And here's the JSLint error:
Expected '===' and instead saw '=='.
But when I listen to the advice and change == to ===, the alert stops appearing.