I have an input field which I want to restrict so that the user only can input a number with the maximum of two decimals. Want to do this using jQuery.
Could I use j
$("#myInput").focusout(function() { if ($(this).val().length > 2 || isNaN(Number($(this).val())) { alert("Wrong number format"); } });