开发者

Select elements with class except one with specific id

$('.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 the开发者_运维百科re 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');


You can try this $('.ui-widget-content').not('#id')

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜