search
HomeWeb Front-endH5 TutorialHTML5 registration page sample code

HTML5 Written by Registration page, friends who are learning html5 can refer to the

code is as follows:

<!DOCTYPE html> 
<html> 
<head> 
<title>register.html</title> 
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> 
<meta http-equiv="description" content="this is my page"> 
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> 
<LINK rel="Shortcut icon" href="favicon.ico" /> 
<link rel="stylesheet" type="text/css" href="css/register.css" /> 
<script src="js/checkbox.js" type="text/javascript"> 
</script> 
<script type="text/javascript"> 
function play(){ 
document.getElementById("menu_item").style.display = ""; 
} 
function noplay(){ 
document.getElementById("menu_item").style.display = "none"; 
} 
function passwd(){ 
var pass = document.getElementById("password").value; 
var tip = document.getElementById("tip"); 
if (pass.length < 4) { 
document.getElementById("meter").value = pass.length; 
tip.innerHTML = "差"; 
} 
else 
if (pass.length <= 8) { 
document.getElementById("meter").value = pass.length; 
tip.innerHTML = "中"; 
} 
else { 
document.getElementById("meter").value = pass.length; 
tip.innerHTML = "高"; 
} 
} 
</script> 
</head> 
<body> 
<p id="3" style="position: relative; top: 100px; z-index: 3;"> 
<form id="f1" action="register.html" method="post"> 
<table align="center" cellspacing="0" class="table"> 
<tr class="thead"> 
<td align="center"> 
会员注册 
</td> 
</tr> 
<tr> 
<td> 
<table id="registertable" border="0px" align="center" border="0px" cellspacing="0" cellpadding="5px"> 
<tr> 
<tr> 
<td align="right"> 
员工编号: 
</td> 
<td align="left"> 
<input type="text" name="username" placeholder="用户名" required/> 
</td> 
</tr> 
<tr> 
<td align="right"> 
密 码: 
</td> 
<td align="left"> 
<input type="password" name="password" id="password" placeholder="密码" required onkeyup="passwd()"/> 
<meter min="1" max="10" low="5" high="8" value="0" id="meter"> 
</meter> 
<span id="tip"></span> 
</td> 
</tr> 
<tr> 
<td align="right"> 
密码确认: 
</td> 
<td align="left"> 
<input type="password" name="password2" placeholder="确认密码" required/> 
</td> 
</tr> 
<tr> 
<td align="right"> 
生 日: 
</td> 
<td align="left"> 
<input type="date" name="borthday" /> 
</td> 
</tr> 
<tr> 
<td align="right"> 
性 别: 
</td> 
<td align="left"> 
<input type="radio" name="gender" value="0" checked/>男 
<input type="radio" name="gender" value="1"/>女 
</td> 
</tr> 
<tr> 
<td align="right"> 
邮 箱: 
</td> 
<td align="left"> 
<input type="email" name="email" placeholder="邮箱" id="email" required/> 
</td> 
</tr> 
<tr> 
<td align="right"> 
手 机: 
</td> 
<td align="left"> 
<input type="tel" pattern="[0-9]{11}" id="p" name="phone" placeholder="请输入11位数字" /> 
</td> 
</tr> 
<tr> 
<td align="right"> 
地 址: 
</td> 
<td align="left"> 
<input type="text" name="address" placeholder="地址" list="l"/> 
<datalist id="l"> 
<option value="sh">上海</option> 
<option value="bj">北京</option> 
<option value="js">江苏</option> 
<option value="zz">郑州</option> 
<option value="sz">深圳</option> 
</datalist> 
</td> 
</tr> 
<tr> 
<td align="right"> 
个人网页: 
</td> 
<td align="left"> 
<input type="url" name="page" placeholder="主页网址" /> 
</td> 
</tr> 
<tr> 
<td align="right"> 
起床时间: 
</td> 
<td align="left"> 
<input type="time" name="bed" onblur="pro()"/> 
</td> 
</tr> 
<tr> 
<td align="right"> 
头像: 
</td> 
<td align="left"> 
<input type="file" id="f" accept="image/jpeg" onchange="show()"/><span><img  src="/static/imghwm/default1.png"  data-src=""    style="max-width:90%"lazy"  id="img"  width="60"  style="max-width:90%" / alt="HTML5 registration page sample code" ></span> 
<script> 
function show(){ 
var file = document.getElementById("f").files[0]; 
var fileReader = new FileReader(); 
fileReader.readAsDataURL(file); 
fileReader.onload = function(){ 
document.getElementById("img").src = fileReader.result; 
} 
} 
</script> 
</td> 
</tr> 
<tr> 
<td colspan="2"> 
<details> 
<p> 
允许注册 
<mark> 
许可证 
</mark>信息 
</p> 
<summary> 
注册许可信息 
</summary> 
</details> 
</td> 
</tr> 
<tr> 
<td align="right"> 
验证码: 
</td> 
<td valign="middle"> 
<input type="text" name="captcha" size="11" maxlength="4" title="输入右边的验证码" /> 
<span id="span"></span> 
<script> 
var span = document.getElementById("span"); 
span.innerHTML=Math.floor(Math.random()); 
</script> 
</td> 
</tr> 
<tr height="60px"> 
<td align="center" colspan="2"> 
<input type="button" value="转到登录" onclick="window.location.replace(&#39;login.html&#39;)" id="btn1" onmousemove="changeBgColor(&#39;btn1&#39;)" onmouseout="recoverBgColor(&#39;btn1&#39;)" class="submit" /> <input type="submit" accesskey="enter" value="注册" id="btn" onmousemove="changeBgColor(&#39;btn&#39;)" onmouseout="recoverBgColor(&#39;btn&#39;);" class="submit" formmethod="post"/> 
</td> 
</tr> 
</table> 
</td> 
</tr> 
</table> 
</form> 
</p> 
</body> 
</html>

the code is as follows:

body { 
background-image: url("../images/bg.jpg"); 
text-align: center; 
background-repeat: repeat-x; 
background-position: 0px 0px ; 
background-size: 
} 
.table { 
border: 1px solid #90BFFF; 
width:810px; 
} 
tr { 
font-family: 微软雅黑; 
font-weight:800; 
color: #448EF3; 
} 
input{ 
border: 1px solid #448EF3; 
color: #448EF3; 
font-weight:bold; 
font-family: "微软雅黑"; 
height: 35px; 
line-height: 30px; 
border-radius:5px; 
} 
.submit { 
width: 150px; 
height: 40px; 
cursor :hand; 
font-size: 20px; 
color: #ffffff; 
background-color: #448EF3; 
border: 0px; 
} 
.thead { 
height: 40px; background : #90BFFF; 
font-family: "微软雅黑"; 
font-size: 30px; 
font-weight: 700; 
color: #ffffff; 
background: #90BFFF; 
} 
#3{ 
margin-bottom: 100px; 
}

The code is as follows:

function ChkAllClick(sonName, cbAllId){ 
var arrSon = document.getElementsByName(sonName); 
var cbAll = document.getElementById(cbAllId); 
var tempState=cbAll.checked; 
for(i=0;i<arrSon.length;i++) { 
if(arrSon[i].checked!=tempState) 
arrSon[i].click(); 
} 
} 
function ChkSonClick(sonName, cbAllId) { 
var arrSon = document.getElementsByName(sonName); 
var cbAll = document.getElementById(cbAllId); 
for(var i=0; i<arrSon.length; i++) { 
if(!arrSon[i].checked) { 
cbAll.checked = false; 
return; 
} 
} 
cbAll.checked = true; 
} 
function ChkOppClick(sonName){ 
var arrSon = document.getElementsByName(sonName); 
for(i=0;i<arrSon.length;i++) { 
arrSon[i].click(); 
} 
} 
function changeBgColor(btn){ 
var btn = document.getElementById(btn); 
btn.style.backgroundColor = "#90BFFF" 
} 
function recoverBgColor(btn){ 
var btn = document.getElementById(btn); 
btn.style.backgroundColor = "#448EF3" 
}



The above is the detailed content of HTML5 registration page sample code. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
html5的div一行可以放两个吗html5的div一行可以放两个吗Apr 25, 2022 pm 05:32 PM

html5的div元素默认一行不可以放两个。div是一个块级元素,一个元素会独占一行,两个div默认无法在同一行显示;但可以通过给div元素添加“display:inline;”样式,将其转为行内元素,就可以实现多个div在同一行显示了。

html5中列表和表格的区别是什么html5中列表和表格的区别是什么Apr 28, 2022 pm 01:58 PM

html5中列表和表格的区别:1、表格主要是用于显示数据的,而列表主要是用于给数据进行布局;2、表格是使用table标签配合tr、td、th等标签进行定义的,列表是利用li标签配合ol、ul等标签进行定义的。

html5怎么让头和尾固定不动html5怎么让头和尾固定不动Apr 25, 2022 pm 02:30 PM

固定方法:1、使用header标签定义文档头部内容,并添加“position:fixed;top:0;”样式让其固定不动;2、使用footer标签定义尾部内容,并添加“position: fixed;bottom: 0;”样式让其固定不动。

html5中不支持的标签有哪些html5中不支持的标签有哪些Mar 17, 2022 pm 05:43 PM

html5中不支持的标签有:1、acronym,用于定义首字母缩写,可用abbr替代;2、basefont,可利用css样式替代;3、applet,可用object替代;4、dir,定义目录列表,可用ul替代;5、big,定义大号文本等等。

HTML5中画布标签是什么HTML5中画布标签是什么May 18, 2022 pm 04:55 PM

HTML5中画布标签是“<canvas>”。canvas标签用于图形的绘制,它只是一个矩形的图形容器,绘制图形必须通过脚本(通常是JavaScript)来完成;开发者可利用多种js方法来在canvas中绘制路径、盒、圆、字符以及添加图像等。

html5废弃了哪个列表标签html5废弃了哪个列表标签Jun 01, 2022 pm 06:32 PM

html5废弃了dir列表标签。dir标签被用来定义目录列表,一般和li标签配合使用,在dir标签对中通过li标签来设置列表项,语法“<dir><li>列表项值</li>...</dir>”。HTML5已经不支持dir,可使用ul标签取代。

Html5怎么取消td边框Html5怎么取消td边框May 18, 2022 pm 06:57 PM

3种取消方法:1、给td元素添加“border:none”无边框样式即可,语法“td{border:none}”。2、给td元素添加“border:0”样式,语法“td{border:0;}”,将td边框的宽度设置为0即可。3、给td元素添加“border:transparent”样式,语法“td{border:transparent;}”,将td边框的颜色设置为透明即可。

html5为什么只需要写doctypehtml5为什么只需要写doctypeJun 07, 2022 pm 05:15 PM

因为html5不基于SGML(标准通用置标语言),不需要对DTD进行引用,但是需要doctype来规范浏览器的行为,也即按照正常的方式来运行,因此html5只需要写doctype即可。“!DOCTYPE”是一种标准通用标记语言的文档类型声明,用于告诉浏览器编写页面所用的标记的版本。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.