选择所有输入,除了Summernote的div中的元素

时间:2017-11-16 08:04:22

标签: javascript jquery html summernote

Summernote的模态有内部输入的模态。

enter image description here

我的JS来到这里:

$('input, select, textarea').on('change',
    function(e){
        var inputs = $('input:text, input[type="radio"]:checked').map(
            function(){
                /* show values */
            }
        ).get();
    }
);

尝试使用not(),但它不起作用:

var inputs = $('input:text, input[type="radio"]:checked')
    .not('div.note-editor > input')
    .map()
    .get();

1 个答案:

答案 0 :(得分:3)

使用>是正确的,但您应该删除input,因为它指定了直接子项var inputs = $('input:text, input[type="radio"]:checked') .not('div.note-editor input') .map() .get(); 不是。所以

{{1}}
相关问题