###监听方法
实时监听input、textarea输入,进行其他的操作。
<body>
<input id="input" type="text" />
</body>
//监听事件
function inputLoad() {
var input = document.getElementById("input");
input.addElementListener("input",test,false); //绑定事件
}
//监听后的操作
function test() {
console.log(this.id);
this.style.background="red";
}
//最后调用监听事件
inputLoad();
OK,任务完成了。