Jquey Filter RRS feed

  • Question

  • User-155787703 posted

    How to make null or not null base select field uisng jquery Query Filter ...

    Monday, November 14, 2016 4:05 PM


  • User-691209617 posted

    Please see below mentioned example and you can use it according to your implementation.

    $('select option')
        .filter(function() {
            return !this.value || $.trim(this.value).length == 0;
    $('select option')
        .prop('selected', true);​
    • you can use .filter() to filter out the empty option elements and remove them all at once

    • use .prop() to set special attributes like selected

    jQuery("#sender_container input.required").filter(function() {
        return !this.value;

    Also read below mention documentation.


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 14, 2016 4:11 PM