<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. jQuery ajax传递特殊字符串问题

    当你用ajax传递值到服务器端,如果值中包含特殊字符串如+,&等,在服务器端获取的结果可能就会出现差异,因为这些字符有其它用途,如“+”表示连接符,在转义后你获取到的就是空格.可以看看这些特殊 ...

  2. webapi 上传图片

    需求:上传学员信息时同时上传头像信息,学员基本信息表和科目表为一对多关系表(添加基本信息后添加通过科目信息).   测试: [HttpPost] public string Post() { if ( ...

  3. jave script 经典排序 - -冒泡排序

    有 5个数字,2:3:1:0:4,按大小顺序排列 <script type="text/javascript"> var arr =new Array(); arr . ...

  4. .NET知识点总结二(笔记整合)

    19.什么是类型? 用来定义某一种数据在内存里开辟空间的大小,还可以预置操作此种类型数据的相关方法 20.this关键字在方法中使用时所代表的含义 this指的是当前类的对象,或者父类的类的对象(ba ...

  5. 最牛B的编码套路 【转】

    原文:http://blog.csdn.net/happydeer/article/details/17023229 最近,我大量阅读了Steve Yegge的文章.其中有一篇叫“Practicing ...

  6. Chrome下的语音控制框架MyVoix.js使用篇(一)

    日前因工作需求,着手研究了语音识别技术,发现github上有网友发布了一款叫做voix.js的javascript框架.在拜读voix.js的源码后发现了不少问题,于是自己写了一款语音识别框架MyVo ...

  7. controller 和 指令 通讯方法

    在 angular 中我们经常会使用多个 controller 和 指令 他们拥有各自的 $scope , 这就产生了跨$scope调用的问题. 有几种常见的方法来可以使用. 方法一 : 指令 req ...

  8. XJOI网上同步训练DAY6 T2

    思路:记得FJ省队集训好像有过这题,可是我太弱了,根本不懂T_T #include<cstdio> #include<iostream> #include<cmath&g ...

  9. VC6.0 编译 gdlib 库

    环境  WinXP, MSVC6.0 1 从  https://bitbucket.org/libgd/gd-libgd/downloads 下载最新版本 libgd 2 可以用 nmake 编译 w ...

  10. 以Crypto++实现RSA加解密二进制数据

    网上一大片讲怎么加解密字符串的,找了大半天也没找到讲加解密二进制数据的,于是自己研究了下,分享给大家. 加解密函数: #include <rsa.h> #include <randp ...