开发者社区 问答 正文

如何把Text里的内容通过发送按钮显示到上面的消息栏里

screenshot
信息框

        <div class="panel-body"style="height:auto">
         Panel content
          </div>
       </div>







       <div style="clear:left;height:70px">
         <button type="button" class="btn btn-success" style="float:left">发送消息</button>
         <button type="button" class="btn btn-danger" style="float:right">清空消息</button>
       </div>



  </div>
   <div style="float:right;width:30%;height:500px">   <!-- 这个是显示在线人数的界面(右上)-->


   </div>
   <div  style="width:auto; height:100px;clear:left" >   <!-- 这是输入框(位于底部)-->
   <div class="well well-lg"style="weight:75%;height:auto"><input type="Textbox" value="Text"style="height:auto;width:90%"></div>

   </div>


</div>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.4.min.js"></script>
<div class="panel-body" style="height:auto" id="body">
    Panel content
</div>
       </div>







<div style="clear:left;height:70px">
    <button type="button" class="btn btn-success" style="float:left" onclick="document.getElementById('body').innerHTML+='<br>'+document.getElementById('txt').value">发送消息</button>
    <button type="button" class="btn btn-danger" style="float:right" onclick="document.getElementById('txt').value=''">清空消息</button>
</div>



  </div>
<div style="float:right;width:30%;height:500px">
    <!-- 这个是显示在线人数的界面(右上)-->


</div>
<div style="width:auto; height:100px;clear:left">
    <!-- 这是输入框(位于底部)-->
    <div class="well well-lg" style="weight:75%;height:auto"><input type="text" value="Text" id="txt" style="height:auto;width:90%"></div>

</div>


</div>

展开
收起
小旋风柴进 2016-03-13 16:13:06 2257 分享 版权
1 条回答
写回答
取消 提交回答
  • 
    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.4.min.js"></script>
    <div class="panel-body" style="height:auto" id="body">
        Panel content
    </div>
           </div>
    
    
    
    
    
    
    
    <div style="clear:left;height:70px">
        <button type="button" class="btn btn-success" style="float:left" onclick="document.getElementById('body').innerHTML+='<br>'+document.getElementById('txt').value">发送消息</button>
        <button type="button" class="btn btn-danger" style="float:right" onclick="document.getElementById('txt').value=''">清空消息</button>
    </div>
    
    
    
      </div>
    <div style="float:right;width:30%;height:500px">
        <!-- 这个是显示在线人数的界面(右上)-->
    
    
    </div>
    <div style="width:auto; height:100px;clear:left">
        <!-- 这是输入框(位于底部)-->
        <div class="well well-lg" style="weight:75%;height:auto"><input type="text" value="Text" id="txt" style="height:auto;width:90%"></div>
    
    </div>
    
    
    </div>
    2019-07-17 19:02:47
    赞同 展开评论
问答分类:
问答地址: