<!DOCTYPE html>
<html>
<head>
<title>清除注释</title>
<meta charset="UTF-8">
<script>
function clearComments() {
var input = document.getElementById("input");
var output = input.value.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g, '');
input.value = output;
}
</script>
</head>
<body>
<input type="text" id="input" placeholder="请输入内容">
<button onclick="clearComments()">清除注释</button>
</body>
</html>