How do i use an "or" statement in jquery, i have two separate statements that i think i can combine to be just one:
$('li.members').hover(function() {
$('.members-show').show();
$('.brokers-show').hide();
$('.providers-show').hide();
$('.employers-show').hide();
$('.seniors-show').hide();
return false;
});
$('li.members-active').hover(function() {
$('.members-show').show();
$('.brokers-show').hide();
$('.providers-show').hide();
$('.employers-show').hide();
$('.seniors-show').hide();
return false;
});
The conditional loops that can be worked in a jQuery script are 'if' statement, 'if..else' statement, and 'if..else if' statement.
$ is pretty commonly used as a selector function in JS. In jQuery the $ function does much more than select things though. You can pass it a selector to get a collection of matching elements from the DOM. You can pass it a function to run when the document is ready (similar to body.
jQuery not() Method: This method returns elements that do not match a defined condition. This method specifies a condition. Elements that do not match the condition are returned, and those that match will be removed. Mostly this method is used to remove one or more than one elements from a group of selected elements.
getElementById("title"). value; var flagu2=0; ..... ..... var flagu6=0; if( flagu1==0 && flagu2==0 && flagu3==0 && flagu4==0 && flagu6==0 ) return true; else return false; } function clearBox(type) { // Your implementation here } // Event handler $submitButton. on('click', handleSubmit); });
$('li.members, li.members-active').hover(function() {
$('.members-show').show();
$('.brokers-show').hide();
$('.providers-show').hide();
$('.employers-show').hide();
$('.seniors-show').hide();
return false;
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With