[問題] 下拉式選一開始就執行某個值

看板Ajax作者 (>\\\\\\\<)時間17年前 (2008/10/04 11:33), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
if (beginPos != -1){ IDname=cookieStr.substring( (beginPos+3), endPos) memNum=cookieStr.substring(endPos+2) document.getElementById("alrselect").innerHTML="<select name=\"select\" id=\"alrselect\" onChange=\"showmessage(this)\"><option value=\"all\">顯示所有 人</option><option value=\"me\">顯示自己的</option><option value=\"no\">不顯示 </option></select>"; } function showmessage(oj){ cookieStr=unescape(document.cookie) beginPos=cookieStr.indexOf("ID") endPos=cookieStr.indexOf("#N")// cookie表尾寫入 IDname=cookieStr.substring( (beginPos+3), endPos) if(oj.value=='all') sendRequest(lexml,{'user_id':IDname,'video_id':document.getElementById("video_id").value},'POST','./php/anchor_all.php',true,true); else if(oj.value=='me') sendRequest(lexml,{'user_id':IDname,'video_id':document.getElementById("video_id").value},'POST','./php/anchor_me.php',true,true); else if(oj.value=='no') document.getElementById("pomessage").innerHTML=''; } <div id="alrselect"> <!--範圍選擇--> <select id="select" name="select" onChange="showmessage(this)"> <option value="all">顯示所有人</option> <option value="no">不顯示</option> </select> </div> <!--顯示選擇後出現的值--> <div id="pomessage"></div> 這主要是讓人點選範圍選擇後,便能出現該對應的值 我想問的是,如何讓使用者一開始進入該網頁就能直接執行option value="all" 有人可以敎我嗎>"<謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.128.28.161
文章代碼(AID): #18vkGaJB (Ajax)
文章代碼(AID): #18vkGaJB (Ajax)