jQuery find first empty form field using the :input selector

Find the first empty form field in JavaScript using jQuery with the example below.

var myform = $("form");
var firstEmptyField = myform.find(":input[value='']:visible").not("button").filter(":first")
console.log("the first empty field: ", firstEmptyField);
If you liked this posting, please feel free to leave me a comment below.
View this page on GitHub.
Posted .

1 comment

  1. anonymous

    Very nice site!

Leave a Reply