当所有下拉列表都更改时,我必须应用一些CSS。请帮助我。
application/json
$("select").change(function() {
alert('test');
});
答案 0 :(得分:0)
var cnt1=0,cnt2=0,cnt3=0;
$(".one").change(function(){
cnt1=1;
if((cnt1==1) && (cnt2==1) && (cnt3==1)){
alert('test');
}
});
$(".two").change(function(){
cnt2=1;
if((cnt1==1) && (cnt2==1) && (cnt3==1)){
alert('test');
}
});
$(".three").change(function(){
cnt3=1;
if((cnt1==1) && (cnt2==1) && (cnt3==1)){
alert('test');
}
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<select name="company1" class="dropdown one">
<option value="1">Group 1</option>
<option value="2">Group 2</option>
</select>
<select name="company2" class="dropdown two">
<option value="1">Group 1</option>
<option value="2">Group 2</option>
</select>
<select name="company3" class="dropdown three">
<option value="1">Group 1</option>
<option value="2">Group 2</option>
</select>