js에 i태그 넣는 방법

js에 i태그 넣는 방법

QA

js에 i태그 넣는 방법

답변 2

본문

안녕하세요 shop.js파일에 i태그를 넣고싶은데 적용이 안되는거 같습니다 ㅠㅠ

혹시 넣는 방법이 따로 있을까요?.. 알려주시면 정말 감사합니다 ㅠㅠ 

아래 shop.js 중 <button type=\"button\" class=\"sit_qty_plus increaseNumber\">부분 다음에
<i class="fas fa-plus" style="font-size:12px;"></i> 이렇게 넣고싶습니다 답변 주실수 있으시면 부탁드리겠습니다. 좋은 하루 보내세요 !



    opt += "<li class=\""+li_class+"\">";
    opt += "<input type=\"hidden\" name=\"io_type["+item_code+"][]\" value=\""+type+"\">";
    opt += "<input type=\"hidden\" name=\"io_id["+item_code+"][]\" value=\""+id+"\">";
    opt += "<input type=\"hidden\" name=\"io_value["+item_code+"][]\" value=\""+option+"\">";
    opt += "<input type=\"hidden\" class=\"io_price\" value=\""+price+"\">";
    opt += "<input type=\"hidden\" class=\"io_stock\" value=\""+stock+"\">";
    opt += "<span class=\"sit_opt_subj\">"+option+"</span>";
    opt += "<span class=\"sit_opt_prc\">"+opt_prc+"</span>";
    opt += "<div><input type=\"text\" name=\"ct_qty["+item_code+"][]\" value=\"1\" class=\"frm_input\" size=\"5\">";
    opt += "<button type=\"button\" class=\"sit_qty_plus increaseNumber\">증가</button>";
    opt += "<button type=\"button\" class=\"sit_qty_minus increaseNumber\">감소</button>";
    opt += "<button type=\"button\" class=\"sit_opt_del btn_frmline\">삭제</button></div>";
    opt += "</li>"

이 질문에 댓글 쓰기 :

답변 2

opt += "<button type=\"button\" class=\"sit_qty_plus increaseNumber\"><i class=\"fas fa-plus\" style=\"font-size:12px;\"></i>증가</button>";

이렇게 하시면 되지 않을까요?

\"가 불편하시면 ' 로 써보세요.

 

문장 묶을때 " " 로 묶으셨다면 "를 쓰면 문장 종료로 인식합니다. 

 

"<li class='"+li_class+"'>"; 이런식으로

 

혹은 그반대로 ' ' 로 묶어주고 "를 안에 써주셔도되요.

 

예 : '<div class="div_subject">'.$fileresults[$i]['wr_subject'].'</div>'

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
filter #js ×
전체 323
© SIRSOFT
현재 페이지 제일 처음으로