Re: [問題] 在select物件中增加onchange attribute...
※ 引述《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
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 3 之 3 篇):
Ajax 近期熱門文章
PTT數位生活區 即時熱門文章