Re: [問題] 在select物件中增加onchange attribute...

看板Ajax作者 (^^)時間16年前 (2009/12/04 17:20), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串3/3 (看更多)
※ 引述《nov17th75 (oxygenic)》之銘言: : 如標題 : 我想在 html select 當中增加 onchange attribute : 原本用的方法是 : <script type="text/javascript"> : var type = document.createElement( "select" ); : type.onchange = "函式名稱( 參數 )"; type.onchange=function(){ anotherFn(theParam); }; //要注意一下theParam 的變數週期(scope)的問題就是... ex type.onchange=function(){ alert("hi"); } : </script> : 但沒有反應 : 是否這樣的方法有錯誤呢? : 先感謝回答! -- What do you want to have ? / What do you have? 從書本中,你可以發現我的各種興趣。 從CD中,你可以瞭解我所喜歡的偶像明星。 或許從文字你很難以瞭解一個人,但從物品可以。 My PPolis , My past. http://ppolis.tw/user/Tony -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.136.217.54
文章代碼(AID): #1B6DHIBj (Ajax)
文章代碼(AID): #1B6DHIBj (Ajax)