Refresh a div with jQuery

前端 未结 4 1319
無奈伤痛
無奈伤痛 2021-01-20 03:27

Is it possible to refresh a single div with jQuery? I have a button that does logout a user. After the button is clicked, I want to show the login form, so I need to re-pars

4条回答
  •  迷失自我
    2021-01-20 03:54

    You can dynamically change the contents of the signup div with jquery as follows:

    $("#signup").html("My New Login Section");
    

    or

    var $loginDiv = $(document.createElement("div")).html("");
    $("#signup").html($loginDiv);
    

提交回复
热议问题