HTML 與 JavaScript 相互轉換

來源:互聯網
上載者:User

<HTML>
<HEAD>
<META http-equiv='Content-Type' content='text/html; charset=gb2312'>
<TITLE>html轉換成js工具-js轉html工具</TITLE>
<script language="javascript">
<!--
     function Click()
  {
       alert('歡迎使用該工具!');
       window.event.returnValue=false;
     }
     document.oncontextmenu=Click;
-->
</script>
<style type="text/css">
<!--
body {
 font-size: 12px;
}
table {
 font-size: 12px;
}
.style1 {font-size: 12px}
-->
</style>
</HEAD>
<BODY >
<table width="70%"  border="0" align="center" cellpadding="3" cellspacing="0">
  <tr>
    <td>
 <p><strong>html原始碼轉換javascript代碼工具</strong></p>
<p>請將html原始碼拷貝到下面表單中: <br>
  <textarea cols="100" rows=8 id="oSource" onpropertychange="change()" ></textarea>
  <br>
  下面表單中是相應的JS代碼: <br />
  <textarea cols="100" rows=8 id="oResult" title="雙擊複製" ondblclick='this.select

();oResult.createTextRange().execCommand("Copy")'></textarea> 
  <br>
  <script>
 function change(){
 oResult.value="document.writeln(/""+oSource.value.replace(////g,"////").replace(/

///g,"///").replace(//'/g,"///'").replace(//"/g,"///"").split('/r/n').join

("/");/ndocument.writeln(/"")+"/")"
 } </script>
</p>
<p><strong>javascrpt原始碼轉換html代碼工具</strong></p>
<P><FONT size=2 class="style1">請將js原始碼拷貝到下面表單中:</FONT> <BR>
  <TEXTAREA id=oResul ondblclick='this.select();oResul.createTextRange().execCommand

("Copy")' title=雙擊複製 onpropertychange=rechange() rows=12 cols=99></TEXTAREA>
<BR>
<span class="style1">下面表單中是相應的HTML代碼: </span><BR>
<TEXTAREA id=Re ondblclick='this.select();this.createTextRange().execCommand("Copy")'

title=雙擊複製 rows=12 cols=99></TEXTAREA>
<SCRIPT>
 function rechange(){
 Re.value=oResul.value.replace(/document.writeln/("/g,"").replace(/"/);/g,"").replace

(////"/g,"/"").replace(////'/g,"/'").replace(//////g,"//").replace(//////g,"//")
 }
 </SCRIPT>
 </td>
  </tr>
</table>
</BODY></HTML>

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.