코드를 클릭하여 경고를 표시하려고하는데 코드가 작동하지 않는 것 같습니다. 여기 JQuery 클릭 기능이 작동하지 않습니다.
https://jsfiddle.net/MGames/9eu94Lau/1/
내 HTML입니다 :<div class="add-cart-button-col col-right">
<a class="checkout-button nsg-button nsg-grad--heeb-orange" href="https://mycheckoutlinkgoeshere.com" data-query="https://linkcheckoutgoeshere.com">
CHECKOUT
</a>
</div>
그리고 여기
$(".checkout-button nsg-button nsg-grad--heeb-orange").click(function() {
alert('hohoho');
});
을 클릭 한 후 경고를 표시하지 않는 코드입니다 나는 여기에 코드를 작성했습니다 내가 뭘 잘못하고 있는지 찾아내는 도움을 주시면 감사하겠습니다. 고맙습니다.
편집 :이 질문은 코드에 존재하는 오류에 대한 설명을 요구하고 있기 때문에 다릅니다. 그것은 jQuery를 선택기 여러 클래스 사용
https://stackoverflow.com/questions/1041344/how-can-i-select-an-element-with-multiple-classes-in-jquery –
'.checkout-button nsg-button nsg-grad-- heeb-orange'! =='.checkout-button .nsg-button .nsg-grad-heeb-orange' –