Answers for "how to make input empty in jquery"

C#
2

empty the value of an input in jquery

$('#field').val('');
Posted by: Guest on July-07-2020
1

how can prevent the empty input in jquery

$('#form').submit(function() {
    if ($.trim($("#email").val()) === "" || $.trim($("#user_name").val()) === "") {
        alert('you did not fill out one of the fields');
        return false;
    }
});
Posted by: Guest on April-19-2021

Code answers related to "how to make input empty in jquery"

C# Answers by Framework

Browse Popular Code Answers by Language