html 질문 채택완료
e_compare = - 1
let gh = 'color_blue';
let safe = '안심';
let cls_safe = 'safe';
const t_month = '05';
const t_day = '21';
TOTAL = 111
str = "
전일대비" + abs_compare + "%
" + "총 납부 금액 " + t_month + "/ " + t_day + "(기준)
" + " " + addComma(obj.realTime.TOTAL) + "" + " 원" + "const $br = $(' ')
const $span_compare = $('', {
classNmae: gh,
html: abs_compare + '%'
});
const $p_compare = $('
', {text: "전일대비"
}).append($span_compare);
let $li = $('
').append($p_compare);// div , p, strong, sapn
const $p_pay = {
className: 'payment',
text: '총 납부 금액' + $br + t_month + "/ " + t_day + "(기준)"
}
const $stong_sum = {
className: "sum",
text: addComma(obj.realTime.TOTAL)
}
const $span_uinit = {
className: "unit",
text: "원"
}
const $span_safe = {
className: cls_safe,
text: safe
}
const $div = $('div', {
className: 'graph',
}).append($p_pay).append($stong_sum).append($span_uinit);
$li.append($div)
$('#goalEng').append($li);
답변 1개
str = "
전일대비" + abs_compare + "%
" + "총 납부 금액 " + t_month + "/ " + t_day + "(기준)
" + " " + addComma(obj.realTime.TOTAL) + "" + " 원" + "
하드 코딩 된것을
하드코딩 아래에 된 부분처럼
$요소 = $('엘레멘트', {
text: '내용'
})
$("#부모").append($요소)
이렇게 표현 가능할까요?
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인