<!DOCTYPE html>
<html>
    <head>
        <meta charset=utf-8>
    </head>
    <body>
    	<input id="input" type="text" />
        <span id="span"></span>

        <script type="text/javascript">
            document.getElementById("input").onchange = function(){
                // dom事件里的函数的this指向触发者,即input标签
                // 注意:这里不能使用箭头函数,因为箭头函数没有this指针,箭头函数的this是根据执行上下文确定的,即这里的this指向window,会报错
                document.getElementById("span").innerHTML = this.value
            }
        </script>
    </body>
</html>