Hot to prevent .text to escape the html tags on the browser?

前端 未结 2 399
野的像风
野的像风 2021-01-28 15:44

The following code apparently escapes the HTML tags and prints

Full Membership - 1 Year:$25

on the Bro

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-28 15:58

    try .html :-

    $(".ms_total").html("

    Full Membership - 1 Year:$25

    ");

    As documented in official site :-

    Get the HTML contents of the first element in the set of matched elements or set the HTML contents of every matched element.

提交回复
热议问题