<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script>
function xianshi(id,xian){
document.getElementById(id+"span").innerHTML="<font color='red'>"+xian+"</font>";
}
function weikong(id,kong){
var e1=document.getElementById(id).value;
if(e1==""){
document.getElementById(id+"span").innerHTML="<font color='#FF0000'>"+kong+"</font>";
}else{
document.getElementById(id+"span").innerHTML="";
}
}
</script>
</head>
<body>
<form action="#" method="get" name="regfome" onsubmit="return checkForm()">
<table height="80px">
<tr>
<td width="100px">用户名</td>
<td><input type="text" name="" id="user" onfocus="xianshi('user','请输入用户名')" onblur="weikong('user','用户名不能为空')" />
<span id="userspan"></span>
</td>
</tr>
<tr>
<td>密码</td>
<td><input type="password" name="" id="password" onfocus="xianshi('password','请输入密码')" onblur="weikong('password','密码不能为空')"/>
<span id="passwordspan"></span>
</td>
</tr>
<tr>
<td>密码</td>
<td><input type="password" name="" id="password"/>
</td>
</tr>
<tr>
<td><input type="submit" value="注册"/>
</td>
</tr>
</table>
</form>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script>
function init(){
setInterval("lunbo()",300);
}
var i=2;
function lunbo(){
i++;
document.getElementById("a").src="img/"+i+".jpg";
if(i==4){
i=1;
}
}
</script>
<style>
div{
width: 100px;
margin: auto;
}
</style>
</head>
<body onload="init()">
<div>
<img src="img/2.jpg"id="a">
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script>
function init(){
setInterval("a()",3000);
}
i=2;
function a(){
i++;
document.getElementById("lunzhuan").src="img/"+i+".jpg";
if(i==4){
i=2;
}
}
</script>
<style>
div{
width: 100px;
height: 100px;
margin: auto;
}
</style>
</head>
<body onload="init()">
<div>
<img src="img/2.jpg" style="width: 100%;" id="lunzhuan">
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script>
function init(){
setInterval('a()',2000);
}
var i=2;
function a(){
i++;
document.getElementById("a").src="img/"+i+".jpg"
if(i==4){
i=1;
}
}
</script>
</head>
<body onload="init()">
<div>
<img src="img/2.jpg" id="a">
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script>
function init(){
setInterval('a()',1000);
t=setInterval('b()',4000);
}
var i=2;
function a(){
i++;
document.getElementById("a").src="img/"+i+".jpg";
if(i==4){
i=1;
}
}
function b(){
var c=document.getElementById("b");
c.style.display="block";
clearInterval(t)
t=setInterval('e()',20000);
}
function e(){
document.getElementById("b").style.display="none";
clearInterval(t);
}
</script>
</head>
<body onload="init()">
<div>
<img src="img/1.jpg" style="display: none;" id="b">
</div>
<div>
<img src="img/2.jpg" id="a">
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script>
function init(){
setInterval('a()',1000);
t=setInterval('b()',2000);
}
var i=1;
function a(){
i++;
document.getElementById("a").src="img/"+i+".jpg";
if(i==4){
i=0;
}
}
function b(){
var a=document.getElementById("b");
a.style.display="block";
clearInterval(t);
t=setInterval('c()',4000);
}
function c(){
document.getElementById("b").style.display="none";
}
</script>
</head>
<body onload="init()">
<img src="img/1.jpg" style="display: none;" id="b">
<div>
<img src="img/1.jpg" id="a">
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script>
function init(){
setInterval('a()',1500);
t=setInterval('b()',3000);
}
var i=1;
function a(){
i++;
document.getElementById("a").src="img/"+i+".jpg";
if(i==4){
i=0;
}
}
function b(){
var c=document.getElementById("b");
c.style.display="block";
clearInterval(t);
t=setInterval('e()',4000);
}
function e(){
document.getElementById("b");
clearInterval("t")
}
function f(id,xian){
document.getElementById(id+"span").innerHTML="<font color='red'>"+xian+"</font>";
}
function f1(id,kong){
var a=document.getElementById(id).value;
if(a==""){
document.getElementById(id+"span").innerHTML="<font color='red'>"+kong+"</font>";

}else{
document.getElementById(id+"span").innerHTML="";
}
}
// function bijiao(){
// var a1=document.getElementsByClassName("e").value;
// var a2=document.getElementsByClassName("e1").value;
// if(a1!=a2){}
// document.getElementById("e1span").innerHTML="<font color='red'>"+"两次密码不相等"+"</font>";
// }else{
// document.getElementById("e1span").innerHTML="";
// }
</script>
</head>
<body onload="init()">
<img src="img/1.jpg" style="display: none;" id="b">
<div>
<img src="img/1.jpg" id="a">
</div>
<table>
<tr>
<td>用户名<input type="text" id="c" onfocus="f('c','请输入姓名')" onblur="f1('c','姓名不能为空')"/>
<span id="cspan"></span>
</td>
<tr>
<td>密码<input type="password" class="e" id="e" onfocus="f('e','请输入密码')"onblur="f1('e','密码不能为空')" />
<span id="espan"></span>
</td>
</tr>
<tr>
<td>确认密码<input type="password" class="e1" id="e1" onfocus="f('e1','请输入密码')"onblur="f1('e1','密码不能为空')" />
<span id="e1span"></span>
</td>
</tr>
<tr>
<td><input type="submit" value="注册"/></td></tr>
</tr>
</table>
</body>
</html>

posted on 2019-03-13 08:21  ~王~  阅读(77)  评论(0编辑  收藏  举报