题解 | #单向绑定#

单向绑定

https://www.nowcoder.com/practice/728b83e2b9b948dbababcc4a494eefc3

<!DOCTYPE html>
<html>
    <head>
        <meta charset=utf-8>
    </head>
    <body>
        <input id="input"type="text"/>
        <span id="span"></span>
 
        <script type="text/javascript">
            // 补全代码
            var input = document.getElementById("input");
            var span = document.getElementById("span");
            input.onchange = function(){
                span.innerHTML = this.value;
            }
        </script>
    </body>
</html>
全部评论

相关推荐

点赞 评论 收藏
转发
1 收藏 评论
分享
牛客网
牛客企业服务