javascript - 我这个js写的文本输入框,错哪里了??麻烦大家给看下,在线等!拜谢了!!
ringa_lee
ringa_lee 2017-04-10 16:19:16
[JavaScript讨论组]

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>

p#p1{
    width:500px;
    height:500px;
    border:1px solid #ccc;
}
textarea#input{
    width:500px;
    height:100px;
    border:none;
    border:1px solid red;
    outline:none;
}

</style>
</head>
<body>

<p id="p1"></p>
<textarea id="input"></textarea>
<button id="btn">发送</button>

<script>
    var opShow=document.getElementById("p1");
    var oInput=document.getElementById("input");
    var oBtn=document.getElementById("btn");
    //oInput.innerHTML="Hello!";
    //var opInput.innerHTML="niaho";
    //console.log(typeof oInput.innerHTML);
    oBtn.onclick=function(){
        //alert(oInput.innerHTML);
        var oText=oInput.innerHTML;
        
        function showText(){
            
            return opShow.innerHTML+oText;
        }
        opShow.innerHTML=showText();
        //oInput.InnerHTML="dfdf";
        //console.log(showText());
        
    }
</script>

</body>
</html>

ringa_lee
ringa_lee

ringa_lee

全部回复(2)
天蓬老师

var oText=oInput.value;

天蓬老师

document.createElement()

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号