jQuery - セレクタの例ではない

jQuery –セレクターの例ではありません

jQueryでは、「not」を使用して、セレクターと一致しないすべての要素を選択します。

  1. $(‘p:not(.class-p1)’) – selects all elements matched by

    that do NOT have a class name of “class-p1”.

  2. $(‘li:not(:only-child)’) – selects all elements matched by

  3. that are NOT the only child of their parent.

  4. $(‘li:not(:first-child)’) – selects all elements matched by that are NOT the first child of their parent.

jQueryの例

jQueryの「not」セレクターの使用方法を示す簡単な例は、ボタンをクリックして再生します。



jQuery not example






jQuery not example

  • class-ul - #1
  • class-ul - #2
  • class-ul - #3
  • class-ul - #4
  • class-ul - #5
  • id1 - #1

class - #p1

class - #p2