Ctrl+/
IE11
F11
ESC
PgUp
PgDn
<script type="text/JavaScript">
function getV(){
var str=document.getElementById("regtext").value;
var re=/([\n\r])(\s)*(\<\/div\>?(\s)*\<div)+/g;
str=str.replace(re,"$3");
alert(str);
}
</script>
<textarea id="regtext" cols="80" rows="20">
<div id="main">
<div id="left">
</div>
<div id="Div1">
<div id="Div2">
<div id="right">
php
</textarea>
<input type="button" onclick="getV()" value="测试" />
body {
background-image: url(/themes/zhan/styles/images/bg-body.jpg);
.main {
width: 80%;
margin: auto;
text-align: center;
border: 1px solid #e0e0e0;
box-shadow: 0 0 2px #ddd;
word-wrap: break-word;
padding: 10px;
border-radius: 3px
JS代码...
xxxxxxxxxx