运行代码 缩小
汉王
HTML代码
复制 格式化 注释 注释 清空
放大
AخA
 
1
<html>
2
<head>
3
<title>HTML转JS代码在线工具</title>
4
<style>
5
.toolcode{margin:0 auto;}
6
h2{font:22px "微软雅黑";color:#333;background-color:lightgreen;}
7
h3{font-size:12px;font-weight:lighter;color:#666}
8
.tool {float:left;margin:12px 0 40px 0;}
9
.toolarea{padding:4px;margin:8px 0;width:650px;height:220px;color:#333;display:block}
10
</style>
11
</head>
12
<body>
13
<div class="toolcode" align="center">
14
<script language=JavaScript> 
15
function rechange(){
16
document.getElementById('re').value=document.getElementById('oresult').value.replace(/document.writeln\("/g,"").replace(/"\);/g,"").replace(/\\\"/g,"\"").replace(/\\\'/g,"\'").replace(/\\\//g,"\/").replace(/\\\\/g,"\\")
17
}
18
function change(){
19
document.getElementById('oresult2').value="document.writeln(\""+document.getElementById('osource').value.replace(/\\/g,"\\\\").replace(/\\/g,"\\/").replace(/\'/g,"\\\'").replace(/\"/g,"\\\"").split('\n').join("\");\ndocument.writeln(\"")+"\");"
20
}
21
</script>
22
<h2>HTML转JS代码工具</h2>
23
<h3>请把HTML代码粘贴在这里:</h3>
24
<textarea class="toolarea" id="osource" onfocus="change()" onkeyup="change()"></textarea>
25
<h3>转换后的Js代码:</h3>
26
<textarea class="toolarea" id="oresult2"></textarea><br />      
27
<h2>JS转HTML代码工具</h2>
28
<h3>把JavaScript代码粘贴在这里:</h3>
29
<textarea class="toolarea" id="oresult" onfocus="rechange()" onkeyup="rechange()"></textarea>
30
<h3>转换后的Html代码为:</h3>
31
<textarea class="toolarea" id="re"></textarea>
32
</div>
33
</body>
34
</html>
CSS代码
复制 格式化 注释 注释 颜色 清空
放大
CSS代码...
x
 
1
JS代码
复制 格式化 注释 注释 清空
放大
JS代码...
xxxxxxxxxx
1
 
1
名称
HTML转JS代码 | 在线HTML/JS代码互转工具
分类
网站常用
描述
HTML/JS代码互转工具,HTML转换JS代码,JS代码转换成HTML代码,简单易用的html代码和js代码在线互转工具,方便你把JavaScript代码转换成html代码或把HTML代码转换为JS代码,转换后的代码可用于广告、淘宝网店等地方,很方便哦。
收藏