div 没有开箱即用的 onchange 事件。如果您想要这个,您将自己编写它(使用计时器并存储当前值等)。
然而,当您更改该 div 的 innerValue 来处理 ... w/e 时,我会尝试退一步并调用一个方法。
There is no out of the box onchange event for divs. If you want this you are going to have write this yourself (with a timer and storing whats the current value etc).
I would however try to take it a step back and call a method when you change the innerValue of that div to take care of ... w/e.
发布评论
评论(3)
使用设置器:
https://developer.mozilla.org/en/Core_JavaScript_1。 5_Guide/Working_with_Objects#Defining_Getters_and_Setters
Use a setter:
https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Working_with_Objects#Defining_Getters_and_Setters
我认为 Fabian 是对的,您需要使用计时器并比较该值。
话虽这么说,在 YUI3 中执行此操作的正确方法是定义一个 合成 DOM事件使用稍后。
I think Fabian's right in that you'll need to user a timer and compare the value.
That being said, the right way to do this in YUI3 would be to define a synthetic DOM event using later.
div 没有开箱即用的 onchange 事件。如果您想要这个,您将自己编写它(使用计时器并存储当前值等)。
然而,当您更改该 div 的 innerValue 来处理 ... w/e 时,我会尝试退一步并调用一个方法。
There is no out of the box onchange event for divs. If you want this you are going to have write this yourself (with a timer and storing whats the current value etc).
I would however try to take it a step back and call a method when you change the innerValue of that div to take care of ... w/e.