I'm encountering a JavaScript issue where I need users to enter a number of seconds in an input field. The catch is that
the number of seconds entered can't be less than zero.
How should I approach this logic in the code?
function sec(){
//Here goes your code logic
console.log("The number of seconds must not be less than");
}
<form>
<label for="seconds">Number of seconds:</label>
<input type="number" id="seconds" name="seconds">
<button onclick="sec()">Click</button>
</form>
Can someone provide guidance on how to tackle this issue?