<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> html2code</title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<script src='f:/study/jquery.js'></script>
<script>
function filter (str) {
str = str.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/\'/g, ''').replace(/\"/g, '"').replace(/\|/g, '¦');
return str;
}
$(function(){
$("#c").click(function(){
$("#d").val(filter($("#s").val().trim()));
});
$("#d").click(function(){
$("#d").select();
});
$("#s").click(function(){
$(this).val("");
});
});
</script>
</head>
<body>
code:<input id="d" style="border:1px solid #1f1;height:60px;width:500px;"/>
<br>
<br>
html:<input id='s' type='text' style="border:1px solid #1f1;height:40px;width:500px;"/>
<br><br>
<input id='c' type='button' style="border:1px solid #1f1;height:40px;width:500px;" value='点击转换html成code'/>
</body>
</html>