사용자가 링크를 누르면 jstore-js-detailLink
클래스의 요소 뒤에 HTML을 삽입하려고합니다.JQuery .on ('click', ...)이 작동하지 않습니다.
내 시도는 작동하지 않습니다
<a href="" class="jstore-js-detailLink">hello</a>
<div class="lsp-popup-item-name"></div>
<script type="text/javascript">
jQuery(document).on('click', 'a[class^=".jstore-js-detailLink"]', function() {
jQuery('<div id="stars-block" class="stars">'+
'<div id="reviewStars-input">'+
'<input id="star-4" type="radio" name="reviewStars"/>'+
'<label title="gorgeous" for="star-4"></label>'+
'<input id="star-3" type="radio" name="reviewStars"/>'+
'<label title="good" for="star-3"></label>'+
'<input id="star-2" type="radio" name="reviewStars"/>'+
'<label title="regular" for="star-2"></label>'+
'<input id="star-1" type="radio" name="reviewStars"/>'+
'<label title="poor" for="star-1"></label>'+
'<input id="star-0" type="radio" name="reviewStars"/>'+
'<label title="bad" for="star-0"></label>'+
'<br>'+
'</div>'+
'</div>').insertAfter(".lsp-popup-item-name");
});
</script>
고맙습니다 내가이야 이미 사용 jQuery를 (문서) CSTE 연구진를 ("클릭", ".jstore --detailLink JS", 기능() {}); –