How can I change an element's text without changing its child elements?

前端 未结 14 2087
难免孤独
难免孤独 2020-11-22 07:30

I\'d like to update element\'s text dynamically:

**text to change** text t
14条回答
  •  北恋
    北恋 (楼主)
    2020-11-22 08:16

    Here is yet another method : http://jsfiddle.net/qYUBp/7/

    HTML

    
    

    JQUERY

    var tmp=$("#header>div").html();
    $("#header").text("its thursday").append(tmp);
    

提交回复
热议问题