use*_*105 5 javascript google-chrome object.observe
我在最新版本的Chrome中使用Object.observe,并想知道为什么它不能用于文本输入的'value'属性.下面的代码将记录添加/更改'foo'属性的更改,但不会更改value属性.谁知道为什么?
var myTextInput = document.getElementById('myTextInput');
Object.observe(myTextInput, function(changes){
changes.forEach(function(change) {
console.log(change);
});
});
myTextInput.value = 'test123';
myTextInput.foo = 'bar';
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
573 次 |
| 最近记录: |