<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>邮箱框</title>
</head>
<body>
<form action="#">
<input type="email" name="email" placeholder="请输入正确的邮箱地址"/>
<p>
<input type="button" value="查看" onclick="getinfo()"/>
<input type="submit"/>
</p>
</form>
<script>
function getinfo(){
var form = document.forms[0];
console.log(form.email.value);
}
</script>
</body>
</html>
时间: 2024-10-29 19:45:41