I have tried in many ways, grouping with ()
of all the ways that I imagined, creating a variable and calling it in the condition etc, but I can find where I am wrong.
$(function() {
$('#id1').change(function(){
if (($(this).val() == '3' || '4') && ('id2' == '5')) {
$('#div1').fadeIn('slow');
$('#div2').hide();
}
else if ($(this).val() == '6' || '7') {
$('#div1').hide()
}
else {
$('#div2').hide();
$('#div1').hide();
}
});
});
I have tried this too:
var tip = document.getElementById("#id2").val;
if (($(this).val() == '3' || '4') && (tip == '5'))
And grouping different:
if ($(this).val() == '3' || '4' && 'id2' == '5')
Or
if (($(this).val() == '3' || '4') && 'id2' == '5')
Follow the link with the example.