select选项在页面刷新的时候不变回默认值

function saveSelectIndex(){
				var typeId=document.getElementById("typeId");
				var typeIdText=typeId.options[typeId.selectedIndex].value;
				document.cookie="typeIdText="+typeIdText;
			}
			
			function selectIndex(){
				var typeIdText=0;
				coosStr=document.cookie;
				var coos=coosStr.split("; ");
				for(var i=0;i
//页面加载完成后执行selectIndex()
//select 的onchange事件执行saveSelectIndex()
//typeId为select的id

你可能感兴趣的:(JavaScript)