javascript - Not class selector in jQuery

ID : 10160

viewed : 37

Tags : javascriptjqueryjquery-selectorsjavascript

Top 5 Answer for javascript - Not class selector in jQuery

vote vote

97

You need the :not() selector:

$('div[class^="first-"]:not(.first-bar)') 

or, alternatively, the .not() method:

$('div[class^="first-"]').not('.first-bar'); 
vote vote

84

You can use the :not filter selector:

$('foo:not(".someClass")') 

Or not() method:

$('foo').not(".someClass") 

More Info:

vote vote

71

You can write a jQuery selector in the "not" method:

$('div[class^="first-"]').not($('.first-bar'))

vote vote

69

vote vote

50

If you are using an AMD CPU, AMD Virtualization (CPUs such as Ryzen) is now officially supported. Make sure you have virtualization switched on in the BIOS.

In "Turn Windows Features On or Off" (you can find it through Windows Search), you'll need to enable

Once you restart and start up the emulator (an x86 build), it should start booting up without the mentioned error.

Top 3 video Explaining javascript - Not class selector in jQuery

Related QUESTION?