<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. C#使用多态求方形面积周长和圆的面积周长

    class class1 { public static void Main(string[] args) { //使用多态求矩形面积与周长和圆的面积与周长 Shape cl = ); double ...

  2. properties文件的读取

    Demo //声明资源器类 Properties pro=new Properties(); //获取路径 URL url= PropertiesTest.class.getClassLoader() ...

  3. hdu5353

    模拟,,, 每个人有一些糖果,每两个人之间只能给一个糖果,问最后是否能让所有人的糖果数量相同,只要确定一个糖果的流向其他的就能够确定. 马虎了,卡了好几天,心塞塞的... #include<io ...

  4. MFC 创建选项卡

    1.创建三个选项卡Dialog窗体,ID分别改为porpTest1.porpTest2.porpTest3 2.创建三个选项卡类,类名分别为CPropTest1.CPropTest2.CPropTes ...

  5. HTML&CSS基础学习笔记1.8-预格式文本

    <pre>标签的主要作用是预格式化文本.被包围在 pre 标签中的文本通常会保留空格和换行符.而文本也会呈现为等宽字体. <pre>标签的一个常见应用就是用来表示计算机的源代码 ...

  6. unexpected problem

    一个比较有趣的字符串问题,问题描述如下 大体意思就是给定一个字符串s以及一个整数m,找出一个能满足以上三个条件的字符串t的个数对10e9 + 7 取余输出. 第二三条是关键,t.s = s.t 举个例 ...

  7. Oracle 存储过程,临时表,动态SQL测试

    --创建事务级别的结果临时表 create global temporary table tmp_yshy( c1 ), c2 ) )on commit delete rows; --创建事务级别的存 ...

  8. jquery.mmenu

    http://mmenu.frebsite.nl/ 左右滑动效果 http://blog.sina.com.cn/s/blog_6a0a183f0100zsfk.html js的左右滑动触屏事件,主要 ...

  9. NSIS脚本调用C语言写的插件

    其实NSIS的官网已经提供了很多别人开发的插件了,今天需要用到GetVersion这个插件,这是不维护的插件了,不推荐用,但是由于现实中的问题,导致我不得不用这个插件. 所以就下载下来了. 下载下来之 ...

  10. Linux企业级项目实践之网络爬虫(14)——使用正则表达式抽取HTML正文和URL

    正则表达式,又称正规表示法.常规表示法(英语:Regular Expression,在代码中常简写为regex.regexp或RE),计算机科学的一个概念.正则表达式使用单个字符串来描述.匹配一系列符 ...