js两个input框内容同步
2021年02月24日
723
js两个input框内容同步

代码如下所示:
html
<input type="text" name="" id="t1"><br/> <input type="text" name="" id="t2">
js
var t1 = document.getElementById('t1');
t1.oninput = function(){
document.getElementById('t2').value = this.value;
}
