我有div標籤下面的UL標籤變化DIV類活躍
<ul class="timeline">
<li onclick="showThis(1);" class="timeline__item">
<div class="timeline__step">
<div class="timeline__step__marker timeline__step__marker--red active></div>
</div>
<div class="timeline__time">
Isert Code
</div>
</li>
<li onclick="showThis(2);" class="timeline__item">
<div class="timeline__step">
<div class="timeline__step__marker timeline__step__marker--red></div>
</div>
<div class="timeline__time">
Select Layout
</div>
</li>
<ul>
$('selector').on('click', function() {
$('selector').removeClass('active');
$(this).addClass('active');
});
如何改變.timeline__step__marker timeline__step__marker--red
到.timeline__step__marker timeline__step__marker--red.active
單擊時?
的腳本不工作對我來說