JSDM

HTML

 
1
<label for= "hello">hello</label>
2
 <input type="text" id='hello'>
3
<input type="button" id="button" value="提交">
4
<div id="container">
5
</div>

CSS

x
 
1
? ?
? ?
必须是有效的URL
+ 添加另一个资源

JS

xxxxxxxxxx
35
 
1
(function(){
2
    var root = this;
3
    function watch(obj, name, func){
4
        var value = obj[name];
5
 
6
        Object.defineProperty(obj, name, {
7
            get: function() {
8
                return value;
9
            },
10
            set: function(newValue) {
11
                value = newValue;
12
                func(value)
13
            }
14
        });
15
 
16
        if (value) obj[name] = value
17
    }
18
 
19
    this.watch = watch;
20
})();
21
22
var obj = {
23
    value: 1
24
}
25
 
26
watch(obj, "num", function(newvalue){
27
   
28
 var container = document.getElementById('container');
29
  console.log(contianer);
30
  document.getElementById('container').innerHTML = newvalue;
31
})
32
 
33
document.getElementById('button').addEventListener("click", function(){
34
    obj.value += 1;
35
});
必须是有效的URL
+ 添加另一个资源
Close

文件管理 点击文件查看URL

图片

  1. 暂无文件

CSS

  1. 暂无文件

JavaScript

  1. 暂无文件

其他

  1. 暂无文件
拖动文件到上面的区域或者:
加载中 ..................