Re: [問題] 下拉式選單的應用?

看板Web_Design作者 (蘇打)時間19年前 (2006/06/13 10:58), 編輯推噓2(200)
留言2則, 2人參與, 最新討論串2/2 (看更多)
※ 引述《sueadolph (人..只剩下不信任)》之銘言: : 請問這樣子的下拉式選單要怎麼設定? : 1.甲 : 2.乙 : 3.丙 : 4.其它 : 當選"其它"的時候,右邊會自動出現一個可輸入的框框 以下是簡單的程式碼..依照需求去改吧:D <html> <head> <script type=text/javascript language=javascript> function showBar() { if( document.getElementById('list').value==4 ) document.getElementById('otherbar').style.visibility="visible"; else document.getElementById('otherbar').style.visibility="hidden"; } </script> </head> <body> <form> <select id=list onchange=showBar()> <option value=1 selected>甲</option> <option value=2>乙</option> <option value=3>丙</option> <option value=4>其他</option> </select> <div id=otherbar style="visibility:hidden"><input type=text></div> </form> </body> </html> -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.138.17.45

06/13 22:48, , 1F
謝謝~
06/13 22:48, 1F

06/14 15:18, , 2F
奇怪..連這樣的程式碼,都會被IE的安全性攔下= =
06/14 15:18, 2F
文章代碼(AID): #14ZYdph7 (Web_Design)
討論串 (同標題文章)
文章代碼(AID): #14ZYdph7 (Web_Design)