title: Is it possible for the browser to cache Javascript/DOM changes?
body: <p>I am developing a form using Javascript for styling that will be used to submit many different things. However, the majority of the time the different things will only be slightly different so it would really benefit users if when you press the <em>Back</em> button on the browser, the form is exactly as you left it before you submitted the form.</p>
  
  <p><strong>Note</strong>: This already works when using a normal HTML/Javascript-less form, the question I am asking is how I can retain this functionality when using Javascript to hide/replace input fields etc.</p>
  
  <p>I've tried <a href="https://github.com/balupton/history.js/" rel="nofollow noreferrer">History.js</a> and HTML5's <code>replaceState()</code> but nothing seems to work. Also if it helps, this will be a private website that requires the latest browser installed so don't feel hesitant to recommend solutions only available in the latest browser releases.</p>
  
  <p>Many thanks!</p>
  
  <p><strong>Update #1</strong>: Here's an image better explaining what I need.</p>
  
  <p><img src="https://i.stack.imgur.com/SI7NV.png" alt="image"></p>
  
  <p><strong>Update #2</strong>: Okay I managed to crack it perfectly, cross-browser included. I'll post a solution tomorrow after I've had some sleep.</p>