본문에있는 a태그를 스크립트의 동적문으로 태그자체 불러오기 채택완료
qoqofh
4년 전
조회 2,197
$("a.href_con").html() a태그자체를 스크립트 동적으로 불러오려면 어떻게 해야할까요? a태그 안에있는 텍스트만 불러와지는 상태여서요 ㅠ 자세히보기 본문에는 이렇게 삽입해놓은 상태입니다.
현재 스크립트 상태입니다.
</p>
<p><!-- 스크립트 -->
<script>
$(".popyt").click(function() {
$(".video-popup").addClass("reveal"),
$(".video-popup .video-wrapper").remove(),
$(".video-popup").append("<div class='video-wrapper'><div class='video-wrapper_div2'><div class='video-wrapper_div'><iframe width='1000' height='563' src='<a href="https://youtube.com/embed/"" target="_blank" rel="noopener noreferrer">https://youtube.com/embed/"</a> + $(this).data("video") + "?rel=0&playsinline=1&autoplay=0' allow='accelerometer; gyroscope; picture-in-picture; encrypted-media' allowfullscreen style=''></iframe><div class='tit_box_con'><span class='ca_name_tit'>" + $(this).find("span").html() + "</span><span class='select_tit'>" + $("h5.select_view").html() + "</span><span class='subject_tit'>" + $(this).find("h4").html() + "</span><span class='wr_content_txt'>" + $(this).find("p").html() + "</span>" + $("div.bo_info_in_right").html() + "<div class='con_download'>" + $("a.href_con").html() + "</div></div></div></div></div>")
});
</script></p>
<p>
댓글을 작성하려면 로그인이 필요합니다.
답변 1개
답변을 작성하려면 로그인이 필요합니다.
로그인