I've updated your jsfiddle and it does what you want:
$( function() {
var clickCount = localStorage.getItem('clickCount');
clickCount = clickCount ? parseInt(clickCount) : 0;
var $num = $('.num');
$num.text(clickCount);
$('.box').click( function() {
$num.text(++clickCount);
localStorage.setItem('clickCount', clickCount);
});
});
I haven't used try ... catch blocks, but in real life you should, as you could get errors trying to access localStorage, because it can be disabled or you could have consumed your disk quota.