How to reset DOM after manipulation?

前端 未结 3 1596
心在旅途
心在旅途 2021-01-20 03:50

My page contains some small wizard which I built using jQuery.

I would like to offer the user to restart/reset the wizard and start it from the beginning level.

3条回答
  •  北海茫月
    2021-01-20 03:56

    The only way to start over without refreshing the page is for you to manually return the DOM to the state it was in when the page loaded and to restore any javascript state too. You would either have to record/remember the initial state so you could go back to it or keep track of all your incremental changes so you could go back there too.

    If you really want to start over, what's wrong with a refresh?

提交回复
热议问题