<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Email Subscription</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
box-sizing: border-box;
background-color: #f8f9fa;
}
.container {
max-width: 600px;
margin: 50px auto;
padding: 20px;
background-color: white;
border-radius: 8px;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
text-align: center;
}
h1 {
color: #333;
}
.form-group {
margin-bottom: 15px;
}
.form-group label {
display: block;
margin-bottom: 5px;
}
.form-group input {
width: 100%;
padding: 10px;
border: 1px solid #ddd;
border-radius: 5px;
}
button {
padding: 10px 20px;
border: none;
border-radius: 5px;
background-color: #28a745;
color: white;
font-size: 1em;
cursor: pointer;
}
button:hover {
background-color: #218838;
}
.success-message {
color: green;
font-weight: bold;
margin-top: 15px;
}
</style>
</head>
<body>
<div class="container">
<h1>Email Subscription</h1>
<form id="subscriptionForm">
<div class="form-group">
<label for="email">Enter your email:</label>
<input type="email" id="email" name="email" required>
</div>
<button type="button" onclick="subscribe()">Subscribe</button>
</form>
<div id="message" class="success-message"></div>
</div>
<script>
function subscribe() {
const emailInput = document.getElementById('email');
if (emailInput.value) {
document.getElementById('message').textContent = 'Subscription successful!';
emailInput.value = '';
}
}
</script>
</body>
</html>
示例 27: 电子邮件订阅表单
原创
©著作权归作者所有:来自51CTO博客作者避风塘主的原创作品,请联系作者获取转载授权,否则将追究法律责任
上一篇:示例 28: 联系我们页面
下一篇:示例 26: 用户反馈表单
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
电子邮件
电子邮件
学习 -
Azure Virtual Desktop 快速上手--配置电子邮件发现订阅
配置客户端电子邮件自动发现订阅的方式
工作区 客户端 AVD Azure虚拟桌面 微软云桌面 -
Outlook 中电子邮件格式对 Internet 电子邮件的影响
Outlook 中电子邮件格式对 Internet 电子邮件的影响
职场 休闲 winmail.dat