2

Summernote's modals have modals with inputs inside.

enter image description here

My JS goes here:

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

Tried to use not() but it doesn't work:

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

1 Answers1

3

Using not is correct, but you should remove the > as it specifies a direct child, which the input is not. So

var inputs = $('input:text, input[type="radio"]:checked')
    .not('div.note-editor input')
    .map()
    .get();
Federico klez Culloca
  • 26,308
  • 17
  • 56
  • 95
  • Ninja! Thought that `>` specifies _indirect_ child. My bad :( – Norman Edance Nov 16 '17 at 08:27
  • 1
    BTW as [Adrien Be](https://stackoverflow.com/users/759452/adrien-be) wrote [here](https://stackoverflow.com/a/29006774/5193609) `:not` has better performance than `.not()`, see [Performance differences between using “:not” and “.not()” selectors?](https://stackoverflow.com/questions/8845811/performance-differences-between-using-not-and-not-selectors) – Norman Edance Nov 16 '17 at 08:39