In the code below if options from both color_select and size_select are selected, only the latest selected option is logged only(e.g either red or small is logged if both are selected depending whichever is selected later). How to log options from both the select(color_select and size_select) on change in one function when option from either of the select is changed (i.e log both red and small if both are selected)?
<h6>Choose Color</h6>
<select id="color_select" name="color" class="form-control" required="">
<option value="" disabled="" selected="">Select</option>
<option value="red">Red</option>
<option value="blue">Blue</option>
<option value="white">White</option>
</select>
<h6>Choose Size</h6>
<select id="size_select" name="size" class="form-control" required="">
<option value="" disabled="" selected="">Select</option>
<option value="small">Small</option>
<option value="large">Large</option>
<option value="medium">Medium</option>
</select>
$('#color_select','#size_select').on('change' , function() {
// Code here
var $this = $(this);
if($this.find('option:selected').index() !== 0){
text = $this.find('option:selected').text();
console.log(text);
}
}).change()