Replace contents of DIV on page load with jquery

前端 未结 3 1797
再見小時候
再見小時候 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:51

    To piggyback off of Curt's answer the full implimentation for this would be this:

    $(document).ready( function() {
        $(".content").text("After");
    });
    

    This will execute when the window has been loaded and update the inner text of the desired div element.

提交回复
热议问题