3
I’ve tried several ways, grouping with ()
in all the ways I imagined, creating a variable and calling it in condition etc, but I can find where I’m missing.
$(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’ve tried that too:
var tip = document.getElementById("#id2").val;
if (($(this).val() == '3' || '4') && (tip == '5'))
And grouping it differently:
if ($(this).val() == '3' || '4' && 'id2' == '5')
Or
if (($(this).val() == '3' || '4') && 'id2' == '5')
Follows a https://jsfiddle.net/gustavox/6e7yo7y2/2/ with the example.
Very good, thanks really, clarified a lot... Hug!
– gustavox