prevent user from entering negative value in javascript code example Example: no negative prices in field type number <input type="number" min="0">