1<html> 2<body bgcolor="white"> 3<script language="JavaScript"> 4var val = window.localStorage.getItem('val'); 5function addLine() { 6 if(val == null) 7 val = '<br/>One Line.'; 8 else 9 val += '<br/>Another Line.'; 10 window.localStorage.setItem('val', val); 11 document.getElementById('out').innerHTML = val; 12} 13</script> 14Click the "Add Line" button to add a line or the "Clear" button to clear.<br/> 15This data will persist across sessions if a cache path was specified.<br/> 16<input type="button" value="Add Line" onClick="addLine();"/> 17<input type="button" value="Clear" onClick="window.localStorage.removeItem('val'); window.location.reload();"/> 18<div id="out"></div> 19<script language="JavaScript"> 20if(val != null) 21 document.getElementById('out').innerHTML = val; 22</script> 23</body> 24</html> 25