$('select').change((a, b, c) => { a = !1; b = $('[id^=name]') for(c of b) if(c.value == 'F200') {a = !0; break} $('save').prop('disabled', a); });