Set content of HTML with Javascript

前端 未结 4 725
旧巷少年郎
旧巷少年郎 2020-12-02 19:52

In a webpage I am calling a WebService that gives me an integer value. I need to display this value in a block of text. I am currently using an HTML

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-02 20:17

    The Maximally Standards Compliant way to do it is to create a text node containing the text you want and append it to the span (removing any currently extant text nodes).

    The way I would actually do it is to use jQuery's .text().

提交回复
热议问题