我的文本区域没有正确记录输出

My textarea is not logging the output correctly

本文关键字:记录 输出 文本 区域 我的      更新时间:2023-09-26

我正在尝试制作一个检查表程序,为此我需要一个输入来将接收到的值记录到文本区域,该部分工作正常,只是当值记录到该文本区域时,它会被放置在框的正中间,单词会离开标记的区域,不会进入下一行。我尝试过这样的方法:(单词换行:break word),以及设置最大宽度,但都不起作用。感谢的帮助

function transfer(){
var move = document.getElementById('chg').value;
document.getElementById('into').value = move;

}

<!DOCTYPE html>
<html>
<head>
    <script src="comp.js"> </script>
    <style>
    #into{ height: 200px; width: 100px; position: absolute margin-top: 100px; word-wrap: break-word}
    #clicker{ margin-left: -1px; margin-top: 22px; position: absolute}
    #chg{position: absolute}
    </style>
</head>
<body>
    <form>
        <input type="text" id="chg" placeholder="Add events and reminders"/>
        <input type="textarea" id="into"/>
        <input type="button" onclick="transfer()" value="Add" id="clicker"/>
    </form>
</body>
</html>

尝试将padding-right:添加到文本区域

#into{ padding-right: 30px; height: 200px; width: 100px; position: absolute margin-top: 100px;}