<html>
<head>
    <title>textarea显示为label</title>
<style type="text/css">
.textdisplay {
   background-color:#eeeeee;
   border-bottom-style:none;
   border-left-style:none;
   border-right-style:none;
   border-top-style:none;
   font-size:14px;
}
</style>
<script language="javascript">
function setTxt(obj){
    if(obj=='e'){
      document.getElementById('sendcontent').className='';
      document.getElementById('sendcontent').readOnly=false;
      document.getElementById('save').disabled=false;
      document.getElementById('cancel').disabled=false;
    }
    if(obj=='c'){
          document.getElementById('sendcontent').className='textdisplay';
          document.getElementById('sendcontent').readOnly=true;
          document.getElementById('save').disabled=true;
          document.getElementById('cancel').disabled=true;
        }
}
  
</script>
</head>
  
<body>
  
<textarea class="textdisplay" cols="" rows="" id="sendcontent" name="sendcontent" style="height:500px;width:600px;" readonly>
 <input type="submit" disabled=true id="save" name="save" value="保存" style="height:24px;vertical-align:middle;line-height:20px;" />
<input type="button" name="edit" value="编辑" style="height:24px; vertical-align:middle;line-height:20px;" onclick="setTxt('e')" />
<input type="button" disabled=true id="cancel" name="cancel" value="取消" style="height:24px; vertical-align:middle;line-height:20px;" onclick="setTxt('c')" />
</body>
</html>

css 文本域textarea显示成label标签的更多相关文章

  1. 文本域textarea显示输入剩余字数

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  2. 文本域textarea

      文本域 CreateTime--2017年5月23日15:12:08Author:Marydon 二.文本域 (一)语法 <textarea></textarea> (二) ...

  3. palacehoder的自定义样式【输入框input /文本域textarea】

    7.palacehoder的自定义样式[输入框input /文本域textarea] 因为每个浏览器的CSS选择器都有所差异,所以需要针对每个浏览器做单独的设定(可以在冒号前面写input和texta ...

  4. 解决:HTML中多文本域(textarea)回车后数据存入数据库,EL表达式取出异常。

    问题描述: 当多文本域(textarea)回车后数据存入数据库. EL表达式取出异常,值换行倒置页面报错. 问题解决: 存值脚本代码,提交前转换\n为<br/>. <script t ...

  5. CSS 文本溢出时显示省略标记

    如标题所示... <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.o ...

  6. 占满屏幕的宽高,当把textarea换成其他标签的时候,怎么才能编辑?

    $('.nav').width($(window).width()); $('.nav').height($(window).height());   当把textarea换成其他标签的时候,怎么才能 ...

  7. Bootstrap 表单控件一(单行输入框input,下拉选择框select ,文本域textarea)

    单行输入框,常见的文本输入框,也就是input的type属性值为text.在Bootstrap中使用input时也必须添加type类型,如果没有指定type类型,将无法得到正确的样式,因为Bootst ...

  8. css文本超出隐藏显示省略号

    p style="width: 300px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"> 如 ...

  9. html文本域textarea高度自增、自动换行

    文本域自动换行.高度自增,采用以下方式: html: <textarea rows="1" class="answerTextArea" maxlengt ...

随机推荐

  1. js函数知识点

    1.即使写成functon a()也是可以调用外面定义的变量的,写(a,b),我估计是为了降低耦合性 2.即使写成function a()也是可以用arguments[a]来默认写了(a,b) 3.在 ...

  2. uva 10125 - Sumsets

    题意: 输入n,然后输入n个数字,,要在这n个数字中找出a,b,c,d..满足a,b,c,d是不同元素,并且a + b + c = d...求出最大的d 直接暴力时间复杂度为O(n^4)..会超时.. ...

  3. centos 服务器装与python34源码安装

    http://www.111cn.net/sys/CentOS/63645.htm 1.CentOS安装Python的依赖包(不安装依赖包,会导致python安装不完整) yum groupinsta ...

  4. Json数据转换

    using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Secu ...

  5. new Handler()和new Handler(Looper.getMainLooper())的区别

    一个帖子的整理: Handler一定要在主线程实例化吗?new Handler()和new Handler(Looper.getMainLooper())的区别如果你不带参数的实例化:Handler ...

  6. 神经网络及其简单实现(MATLAB)

    转自:http://www.cnblogs.com/heaad/archive/2011/03/07/1976443.html 第0节.引例  本文以Fisher的Iris数据集作为神经网络程序的测试 ...

  7. BAT线下战争:巨额投资或培养出自己最大对手(包括美团、58、饿了么在内的公司都在计划推出自己的支付工具和金融产品,腾讯只做2不做O)

    BAT线下战争:巨额投资或培养出自己最大对手 2015年10月12日09:49   <财经>杂志    我有话说(18人参与) 收藏本文        BAT大举投资线下公司,看似咄咄逼人 ...

  8. leetcode_question_119 Pascal's Triangle II

    Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3, Return [1,3 ...

  9. 深入浅出Node.js (7) - 网络编程

    7.1 构建TCP服务 7.1.1 TCP 7.1.2 创建TCP服务器端 7.1.3 TCP服务的事件 7.2 构建UDP服务 7.2.1 创建UDP套接字 7.2.2 创建UDP服务器端 7.2. ...

  10. android ListView用法介绍

    ListView在Android开发中是比较常用的组件,它是以列表的形式展示内容,并且还可以处理用户的选择与点击等操作: LIstView显示数据一般需要三方面: (1)ListView组件:用来展示 ...