回答編集履歴
1
classList
answer
CHANGED
@@ -6,4 +6,12 @@
|
|
6
6
|
- [:checked Selector | jQuery API Documentation](https://api.jquery.com/checked-selector/#checked1)
|
7
7
|
- [.length | jQuery API Documentation](https://api.jquery.com/length/)
|
8
8
|
|
9
|
+
### classList
|
10
|
+
|
11
|
+
> 例えばclass="a b"とclass="b c"のにbtnBだけを表示させたいのですが
|
12
|
+
|
13
|
+
`classList` でクラストークンを疑似配列形式で参照できますので、`for` 文などの繰り返し処理で a, b, c の出現回数をカウントし、「出現回数 = 2」の b を抽出すれば良いと思います。
|
14
|
+
|
15
|
+
- [Element.classList - Web API | MDN](https://developer.mozilla.org/ja/docs/Web/API/Element/classList)
|
16
|
+
|
9
17
|
Re: yuu12345678 さん
|