按照回车换行符给文本添加div标签
来源:互联网 发布:java实现post请求 编辑:程序博客网 时间:2024/06/03 14:51
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Testing</title>
</head>
<body>
<textarea id="txtArea" type="text" style="width:800px;height:400px;border:1px solid red;display:inline-block;" value=""></textarea>
<button onclick="getArray()" style="display:inline">格式化</button>
<textarea id="txtArea1" style="width:800px;height:400px;border:1px solid red;display:inline-block;" value=""></textarea>
<script type="text/javascript">
function getArray(){
var aa = document.getElementById("txtArea").value.split("\n");
var html = "";
for(var i=0;i<aa.length;i++){
html += "<div>"+aa[i]+"</div>" +"\n";
}
document.getElementById("txtArea1").value = html;
}
</script>
</body>
</html>
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Testing</title>
</head>
<body>
<textarea id="txtArea" type="text" style="width:800px;height:400px;border:1px solid red;display:inline-block;" value=""></textarea>
<button onclick="getArray()" style="display:inline">格式化</button>
<textarea id="txtArea1" style="width:800px;height:400px;border:1px solid red;display:inline-block;" value=""></textarea>
<script type="text/javascript">
function getArray(){
var aa = document.getElementById("txtArea").value.split("\n");
var html = "";
for(var i=0;i<aa.length;i++){
html += "<div>"+aa[i]+"</div>" +"\n";
}
document.getElementById("txtArea1").value = html;
}
</script>
</body>
</html>
阅读全文
0 0
- 按照回车换行符给文本添加div标签
- DIV文本自动换行
- div中的文本换行
- oracle替换文本中的换行符、回车符、制表符
- oracle中去掉文本中的换行符、回车符、制表符
- 文本行尾的回车(CR)与换行符(LF)
- 为CString 类型数据添加回车换行符!
- 给div动态添加文本内容(创建属性结点)
- 回车符换行符
- 换行符,回车符
- 关于回车换行符
- 去除回车 换行符
- 回车换行符
- 回车换行符
- 回车换行符总结
- DB2 换行回车符
- 回车-换行符
- ruby回车换行符
- 程序员面试宝典_笔记
- Java校验url是否可用
- Optical_Flow(5)
- 工厂模式
- 【MongoDB】学习(三):配置文件说明
- 按照回车换行符给文本添加div标签
- Spring源码阅读之-utils
- java StringBuffer类 和StringBuilder类
- Python-走进Requests库
- @RequestMapping 用法详解之地址映射
- sweetalert api中文开发文档和手册
- 性能追求之路——MaxCompute2.0的前世今生
- 什么时候学习编程都不晚
- javascript惰性函数