公告版位

用JavaScript寫出動態感覺的下拉式選單!

<html>
<script language=javascript>
changelist();
function changelist()
{
      switch(document.data.test.value)
      {
            case "1":
            document.all.namelist.innerHTML="<select name=actname><option value=1>u1A<option value=2>u1B</select>"
            break;
            case "2":
            document.all.namelist.innerHTML="<select name=actname><option value=1>u1A<option value=2>u1B<option value=3> u1C</select>"
            break;
      }
}                                                                               
</script>     
                                                                         
<form name=data>                                                                          
<select name=test onChange=Javascript:changelist();>
<option value=0 selected>check
<option value=1>mis
<option value=2>csie
</select>
                                                                             
<div id=namelist></div>
                                                                               
</form>                                                                            
</html>

dreamtails 發表在 痞客邦 PIXNET 留言(2) 人氣()


留言列表 (2)

發表留言
  • 悄悄話
  • stan9066
  • 你也真用心ㄟ,幾天沒看你的BLOG沒想到發表那麼多新文章阿~~改謝你阿哈
  • 分享一些經驗!! 互相學習~~!

    dreamtails 於 2008/12/22 02:44 回覆