题解 | #单向绑定#
单向绑定
https://www.nowcoder.com/practice/728b83e2b9b948dbababcc4a494eefc3
我看了所有题解,竟然没人这样写,我开始也习惯了vue,突然不知道怎么写了
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
</head>
<body>
<input id="input" type="text" onchange="change(value)" />
<span id="span"></span>
<script type="text/javascript">
// 补全代码
let content=document.querySelector("#span")
function change(val){
content.innerHTML=val
}
</script>
</body>
</html>
#计算机网络知识点总结##哈啰出行招聘##考研调剂#<html>
<head>
<meta charset=utf-8>
</head>
<body>
<input id="input" type="text" onchange="change(value)" />
<span id="span"></span>
<script type="text/javascript">
// 补全代码
let content=document.querySelector("#span")
function change(val){
content.innerHTML=val
}
</script>
</body>
</html>