首先先写出这个页面的基本样式,用input做输入框
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>计算长度</title>
</head>
<body>
<div style="text-align: center;">
内容:<input type="text" name="len.text" required id="len.text">
</div>
</body>
</html>
然后加上用于开始的button标签
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>计算长度</title>
</head>
<body>
<div style="text-align: center;">
内容:<input type="text" name="len.text" required id="len.text">
<button type="button" onclick="get()">开始</button>
</div>
</body>
</html>