Replace contents of DIV on page load with jquery

前端 未结 3 1800
再見小時候
再見小時候 2021-01-20 22:57

Using jquery is there a way I can take the contents of a DIV and replace it with something else when the page loads?

Before
3条回答
  •  北荒
    北荒 (楼主)
    2021-01-20 23:47

    Use text():

    $(".content").text("After");
    

    Live Demo: http://jsfiddle.net/heY3j/

提交回复
热议问题