showkit様の仰るようにcookie
を使う場合は
lang
1<!doctype html>
2<html>
3<head>
4<meta charset="utf-8">
5<title>cookieTest</title>
6<script>
7window.onload = function(){
8 var select = document.getElementById("inputFromHis");
9 var text = document.getElementById("text");
10 var button = document.getElementById("saveCookie");
11 var reg = /cookie\d=[^;]+;?/g;
12 var cookieString = document.cookie;
13 var histories = [];
14
15 if(cookieString != ""){
16 cookieString.match(reg).forEach(function(str){
17 histories.push(unescape(str.substring(8).replace(";","")));
18 });
19 histories.forEach(function(his){
20 var op = new Option(his,his);
21 select.appendChild(op);
22 });
23 }
24
25 button.addEventListener("click",function(){
26 if(text.value!=""){
27 document.cookie = "cookie"+histories.length+"="+escape(text.value)+"; max-age=604800";
28 var op = new Option(text.value,text.value);
29 select.appendChild(op);
30 }
31 },false);
32
33};
34</script>
35</head>
36<body>
37<select id="inputFromHis">
38</select>
39<br />
40<input type="text" id="text" placeholder="cookie"></input> <button id="saveCookie">save</button>
41</body>
42</html>
みたいな感じでjavascriptを使う必要が出てきます。上のコードは1例です。参考程度に。