怎样用javascript制作相册??
发布网友
发布时间:2022-04-07 06:01
我来回答
共2个回答
热心网友
时间:2022-04-07 07:30
<html>
<head>
<title> New Document </title>
<style type="text/css">
div{
width:600px;
height:50px;
border:1px solid black;
}
</style>
<script type="text/javascript">
function addWebSite()
{
var b=true;
var regExp=/^[w]{3}\.[a-zA-Z]+\.com$/;
var nLength=document.getElementById('websitename').value.length;
if(nLength < 0&&nLength > 100)
{
b=false;
}
var websiteAddr=document.getElementById('websiteaddr').value;
if(!regExp.test(websiteAddr)){
b=regExp.test(websiteAddr)
}
var obj=document.createElement('a');
var pObj=document.getElementById('fs');
alert(pObj.nodeName);
if(b)
{
obj.href=websiteAddr;
obj.innerHTML=document.getElementById('websitename').value;
pObj.appendChild(obj);
}
}
</script>
</head>
<body>
<form action="url" method="post" onsubmit="return false;">
<div>
<label>网站名称:</label><input id="websitename" name="websitename" style="color:#ffccff" type="text" value="websitename" onfocus="if(this.value=='websitename'){this.value=''}" onblur="if(this.value==''){this.value='websitename'}"/>
热心网友
时间:2022-04-07 08:48
你应该去下载一些js图片特效广告展示源码学习