jQuery to get all input fields which are not hidden nor display: none

jQuery is sooo powerful, no wonder its used on almost half the worlds sites.

Here's some code to find in #myForm all input types of text which are not hidden fields or display: none and iterate over them


        $('#myForm input[type=text]:input:not(input:hidden)').each(function() {
            console.log("In each and value is: " + $(this).val() + " id is: " + this.id);
                       
        });

There is a difference between input[type=hidden] and input:hidden. The latter includes type hidden as well as display none which is what I wanted.

Comments

Popular posts from this blog

deep dive into Material UI TextField built by mui

angular js protractor e2e cheatsheet

react-router v6.4+ loaders, actions, forms and more