Select elements with class except one with specific id

后端 未结 3 1781
不思量自难忘°
不思量自难忘° 2021-01-13 17:39
$(\'.ui-widget-content\').css(\'border\',\'none\');
    $(\'#helpDialog .ui-widget-content\').addClass(\'HelpDialogBorder\');

I am doing like this

相关标签:
3条回答
  • 2021-01-13 18:02

    Try this (also see my jsfiddle):

    $('.ui-widget-content').not('#helpDialog').css('border','none');
    
    0 讨论(0)
  • 2021-01-13 18:28

    Sure, use :not():

    $('.ui-widget-content:not(#helpDialog)').css('border', 0);
    
    0 讨论(0)
  • 2021-01-13 18:29

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

    0 讨论(0)
提交回复
热议问题