html 測試 上入 下出
<div id="ud123">
<textarea class="LLtextA" spellcheck="false" style="display: none;" wrap="logical">
HTML input
</textarea>
<div class="DP">00</div></div>
<script>udFT('ud123','300');</script>
00
<style>
.udt , .udf{ width:100%; background-color:azure;font-size:18px}
.uds { background-color:azure;
cursor:pointer;
float:left; display:
table-cell;
vertical-align: middle;
text-align: center;
width: 80px;
height: 30px;
border: thin solid black;
font-size:18px }
</style>
<script>
/* --------NEW UP----LOAD-----------*/
function udFT(x,w1){
var x0 = document.getElementById(x);
var x1 = x0.querySelector(".DP");
var strVar="";
strVar += "<table border='2' style='width: 100%;'>";
strVar += "<tbody >";
strVar += "<tr ><td >";
strVar += "<form>";
strVar += "<div class='uds' id='" + x + "AL1' onclick='udDP(this.id)'>預覽</div>";
strVar += "<div class='uds' id='" + x + "AL3' onclick='udRS(this.id)'>還原</div><br>";
strVar += "<textarea class='udt' style='height:" + w1 + "px' id='" + x+ "TTL' spellcheck='false' wrap='logical'>";
strVar += "<\/textarea><br>";
strVar += "<iframe class='udf' style='height:" + w1 + "px' id='" + x + "ifL' ><\/iframe>";
strVar += "<\/form>";
strVar += "</td></tr>";
strVar += "</tbody>";
strVar += "</table>";
x1.innerHTML=strVar ;
udRS(x+"AL1");
}
</script>
<script>/* --------NEW UP-----DP-----------*/
function udDP(qq1){
var Mid= qq1.substring(0,qq1.length-3);
var Ttext = document.getElementById(Mid+'TTL').value;
var Ri= document.getElementById(Mid+'ifL');
Ri.innerHTML = "";
var ifrw = (Ri.contentWindow) ? Ri.contentWindow : (Ri.contentDocument.document) ? Ri.contentDocument.document : Ri.contentDocument;
ifrw .document.open();
ifrw .document.write(Ttext);
ifrw .document.close();
}
</script>
<script>/* --------NEW UP-----rs-----------*/
function udRS(qq1){
var Mid= qq1.substring(0,qq1.length-3);
var x0 = document.getElementById(Mid);
var LL = x0.querySelector(".LLtextA");
document.getElementById(Mid+'TTL').value = LL.value;
udDP(qq1);
}
</script>
<div id="ud123">
<textarea class="LLtextA" spellcheck="false" style="display: none;" wrap="logical">
HTML input
</textarea>
<div class="DP">
00</div>
</div>
<!----------------------------------------------------------------------------------->
<script>
udFT('ud123','300');
</script>
.udt , .udf{ width:100%; background-color:azure;font-size:18px}
.uds { background-color:azure;
cursor:pointer;
float:left; display:
table-cell;
vertical-align: middle;
text-align: center;
width: 80px;
height: 30px;
border: thin solid black;
font-size:18px }
</style>
<script>
/* --------NEW UP----LOAD-----------*/
function udFT(x,w1){
var x0 = document.getElementById(x);
var x1 = x0.querySelector(".DP");
var strVar="";
strVar += "<table border='2' style='width: 100%;'>";
strVar += "<tbody >";
strVar += "<tr ><td >";
strVar += "<form>";
strVar += "<div class='uds' id='" + x + "AL1' onclick='udDP(this.id)'>預覽</div>";
strVar += "<div class='uds' id='" + x + "AL3' onclick='udRS(this.id)'>還原</div><br>";
strVar += "<textarea class='udt' style='height:" + w1 + "px' id='" + x+ "TTL' spellcheck='false' wrap='logical'>";
strVar += "<\/textarea><br>";
strVar += "<iframe class='udf' style='height:" + w1 + "px' id='" + x + "ifL' ><\/iframe>";
strVar += "<\/form>";
strVar += "</td></tr>";
strVar += "</tbody>";
strVar += "</table>";
x1.innerHTML=strVar ;
udRS(x+"AL1");
}
</script>
<script>/* --------NEW UP-----DP-----------*/
function udDP(qq1){
var Mid= qq1.substring(0,qq1.length-3);
var Ttext = document.getElementById(Mid+'TTL').value;
var Ri= document.getElementById(Mid+'ifL');
Ri.innerHTML = "";
var ifrw = (Ri.contentWindow) ? Ri.contentWindow : (Ri.contentDocument.document) ? Ri.contentDocument.document : Ri.contentDocument;
ifrw .document.open();
ifrw .document.write(Ttext);
ifrw .document.close();
}
</script>
<script>/* --------NEW UP-----rs-----------*/
function udRS(qq1){
var Mid= qq1.substring(0,qq1.length-3);
var x0 = document.getElementById(Mid);
var LL = x0.querySelector(".LLtextA");
document.getElementById(Mid+'TTL').value = LL.value;
udDP(qq1);
}
</script>
<div id="ud123">
<textarea class="LLtextA" spellcheck="false" style="display: none;" wrap="logical">
HTML input
</textarea>
<div class="DP">
00</div>
</div>
<!----------------------------------------------------------------------------------->
<script>
udFT('ud123','300');
</script>
沒有留言:
張貼留言