$(document).ready(function() {
$('#mydropdown').change(function() {
var selectedOption = $(this).val();
var x = 'my_trigger_value';
if (selectedOption === x) {
dosomething();
}
});
$('#my_trigger_value').change(function() {
var isChecked = $(this).is(':checked');
if (isChecked) {
dosomething();
}
});
// Function to be called
function dosomething() {
console.log("Condition met (through dropdown OR through checkbox)!");
}
});
1条答案
按热度按时间iecba09b1#
个字符