$('.ui-widget-content').css('border','none');
$('#helpDialog .ui-widget-content').addClass('HelpDialogBorder');
I am doing like this to remove border. But, there is an element where I want to keep border.
Is there any way in first line itself to select all elements with class "ui-widget-content" but except one with id "helpDialog"?
Sure, use :not()
:
$('.ui-widget-content:not(#helpDialog)').css('border', 0);
Try this (also see my jsfiddle):
$('.ui-widget-content').not('#helpDialog').css('border','none');
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