예컨대 :jquery에서 특수 클래스를 다른 클래스로 대체하려면 어떻게해야합니까?
<li class="dataItem ready igto" status="ready">I will change status to waiting</li>
하고는, 난 그냥클래스 준비을 제거하고 새로운 클래스를 추가 에 국지적 일반적인 방법은 대기에 준비 클래스를 변경하려면!
또 다른 상황은 한 번에 여러 클래스를 교체하는 방법입니다!? 예컨대 님의
<!-- replace done wainting error to ready -->
<li class="dataItem done igto" status="ready">I will change status to ready</li>
<li class="dataItem waiting igto" status="ready">I will change status to ready</li>
<li class="dataItem error igto" status="ready">I will change status to ready</li>
:
<li class="dataItem ready igto" status="ready">I will change status to waiting</li>
가 대단히 감사합니다!
일 먼저하고 깨끗한. – JCOC611
신뢰할 수 없습니다. 우리가 원하지 않을 때에도 매번 토글됩니다. – sidney
@sidney 요점은'$ .fn.toggleClass'이 어떻게 작동 하는지를 보여주는 것입니다. 특정 상황에서만 조건부로 실행되도록 조건부로 랩핑을 사용하는 사용자에게 달려 있습니다. – Sampson