【发布时间】:2013-12-24 09:35:42
【问题描述】:
我有一个 Onchange() 事件,当对选择进行更改时会触发该事件。我想要做的是在 onchange() 事件中有两个函数。但我希望这取决于选择的功能。所以我目前在我的 onchange() 中有:
<SELECT NAME="clothing" onChange="updateforclothingnew(); updateforclothing()">
我有两个 javascript 函数:updateclass 和 updateclassnew
我想要这样,如果 updateclass 运行,那么 updateforclothing() 就会被触发 如果 updateclassnew 运行,则触发 updateforclothingnew()。
如何将它放入我的 onchange() 事件中?
提前致谢!
【问题讨论】:
-
如果你有相互依赖的函数,为什么不以级联方式调用它们呢?如果运行了 updateclassnew() 那么为什么不从中调用 updateforclothingnew() 呢?
标签: javascript html function select onchange