邮箱文本框

<!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>

原文地址:https://www.cnblogs.com/kulowreidyql/p/5663055.html