<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF8"> <meta name="viewport" content="width=devicewidth, initialscale=1.0"> <title>Contact Form</title> <style> body { fontfamily: Arial, sansserif; } form { width: 300px; margin: 0 auto; } input, textarea { width: 100%; marginbottom: 10px; } button { width: 100%; backgroundcolor: #4CAF50; color: white; padding: 10px; border: none; cursor: pointer; } button:hover { backgroundcolor: #45a049; } </style> </head> <body> <form id="contactform"> <h2>Contact Us</h2> <input type="text" id="name" placeholder="Name" required> <input type="email" id="email" placeholder="Email" required> <textarea id="message" placeholder="Message" rows="5" required></textarea> <button type="submit">Submit</button> </form> <script> document.getElementById("contactform").addEventListener("submit", function(event) { event.preventDefault(); var name = document.getElementById("name").value; var email = document.getElementById("email").value; var message = document.getElementById("message").value; if (name === "" || email === "" || message === "") { alert("Please fill in all fields."); } else { alert("Thank you for contacting us! We will get back to you shortly."); this.reset(); } }); </script> </body> </html>(图片来源网络,侵删)
HTML隐藏滚动条
版权声明:主机测评不销售、不代购、不提供任何支持,仅分享信息/测评(有时效性),自行辨别,请遵纪守法文明上网。
文章名称:《HTML隐藏滚动条》
文章链接:https://www.yunzhuji.net/internet/155567.html
文章名称:《HTML隐藏滚动条》
文章链接:https://www.yunzhuji.net/internet/155567.html
相关推荐
如何利用CSS样式美化和定制HTML表格?
CSS中如何实现鼠标悬停时变为小手图标?
什么是‘valign’?探索其在文本排版中的作用与应用
如何实现CSS图片自适应?
orangevps:中国新年特惠,美国和新加坡VPS低至-$15.88/年,2G内存/2核/20GNVMe/1888G流量/1Gbps带宽
tmhhost:开工特惠,香港/洛杉矶云服务器-188元/年,双ISP住宅IP,CN2-GIA/CUII/4837高端高速网络
搬瓦工DC99特价VPS:$34.5/年,1G内存/1核/20gSSD/1T流量/1Gbps带宽,三网cn2gia回国
腾讯云年终盛典 拼团嗨购 轻量 2核2G3M低至38元 轻量 4核8G12M=428元 超值优惠!
评论
暂无评论
最新评论
本站CDN与莫名CDN同款、亚太CDN、速度还不错,值得推荐。
感谢推荐我们公司产品、有什么活动会第一时间公布!
我在用这类站群服务器、还可以. 用很多年了。