jQuery add text to span within a div

后端 未结 3 1868
感动是毒
感动是毒 2020-12-23 16:28

How would I do to add some text within the span like code below ?

<
3条回答
  •  情书的邮戳
    2020-12-23 16:55

    Careful - append() will append HTML, and you may run into cross-site-scripting problems if you use it all the time and a user makes you append('').

    Use text() to replace element content with text, or append(document.createTextNode(x)) to append a text node.

提交回复
热议问题