테스트 사이트 - 개발 중인 베타 버전입니다

html 질문 채택완료

더SUN 4년 전 조회 4,588

 

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) + "" + " " + "
    " + " " + safe + "" + "
  • " $('#goalEng').append(str);

    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) + "" + " " + "
    " + " " + safe + "" + "
  • " $('#goalEng').append(str);

     

    하드 코딩 된것을

    하드코딩 아래에 된 부분처럼 

     

    $요소 = $('엘레멘트', {

        text: '내용'

    })

     

    $("#부모").append($요소)

    이렇게 표현 가능할까요?

    로그인 후 평가할 수 있습니다

    댓글을 작성하려면 로그인이 필요합니다.

    답변을 작성하려면 로그인이 필요합니다.

    로그인