切换主题
字数
79 字
阅读时间
1 分钟
html
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<head>
<title>排序测试</title>
<link rel="stylesheet" type="text/css" href="paixu.css">
</head>
<body>
<form>
<input type="text" id = "inputValue">
</form>
<button onclick="reverseString()">reverse</button>
<div class="result" id="showValue"></div>
</body>
<script>
function reverseString(){
const inputValue = document.getElementById('inputValue').value;
exportValue = inputValue.split('').reverse().join('');
document.getElementById('showValue').textContent=`this is result :\n \ \ \ \ ${exportValue}`;
}
</script>
</html>