javascript - jQuery do something when select options' values are not empty/NULL -


here's scenario. supposing have multiple <select>'s on page (can 0,1,2,3,4 or more) , want piece of code fire when option values not equal "" or null. there quick fire method in jquery find this? selects in <div> tag class of class="variations" no useful classes or id's selects present dynamically generated based on current page/product id.

i can work when 1 or other not equal "" or null can't seem fire when both selected (and fire again when both unselected, if makes sense).

you may try this

$('.variations').on('change', 'select', function(){     if(this.value){         //     } }); 

demo.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -