如何在另一个文本区域中动态显示文本区域的内容作为用户 id 键入它。这应该通过使用 Javascript 来完成
Try this
function majText(){
document.getElementById("textarea2").value = document.getElementById("textarea1").value;
}
<textarea id="textarea1" onKeyUp="majText()"></textarea>
<textarea id="textarea2"></textarea>
or this
function majText(value){
document.getElementById("textarea2").value = value;
}
<textarea id="textarea1" onKeyUp="majText(this.value)"></textarea>
<textarea id="textarea2"></textarea>
Using jquery:
$(function() {
$("#TextArea1").keyup(function() {
$("#TextArea2").val($("#TextArea1").val());
});
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.