問題タブ [htmlcollection]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
2 に答える
214 参照

javascript - HTMLCollection 内の特定の (一意の) クラスを持つ要素のインデックスを取得する

タイトルで。

HTML:

Javascript (バニラ):

私が取得する必要があるのは、現在active内にクラスがある要素のインデックスですtheCollection