Jquery browser history

Can somebody help me make this work
I have a form that is split into four parts
i use only one button next
which is append to every step of the form
i just hide the form everytime i click next
how can i create a browser history
using this

i already manage to create the hash but it does not
do anything

this is my code as of now
$(window).hashchange( function(){
var hash = location.hash;
window.location.hash= ‘step’+curPage;
// Set the page title based on the hash.
document.title = 'The hash is ’ + ( hash.replace( /^#/, ‘’ ) || ‘step1’ ) + ‘.’;

// id=“step’+curPage+'” href=“localhost/carolform/signup.php#step’+curPage+'”
// Iterate over all nav links, setting the “selected” class as-appropriate.
var that = $(this);
that that.attr( ‘href’ ) === hash ? ‘addClass’ : ‘removeClass’ ;