<html>
<body>
<FORM METHOD="GET" ACTION="http://google.com/search" NAME="f" >
Search Page: <INPUT TYPE="text" NAME="q" >
<INPUT TYPE="submit" VALUE="提交資料">
</FORM>
</body>
</html>
2014年4月28日 星期一
LAB20
<html>
<body>
<FORM METHOD="GET" ACTION="http://maps.google.com/maps" NAME="f" onsubmit="return check()">
input place:<INPUT TYPE="text" NAME="q">
<INPUT TYPE="submit" VALUE="送出資料">
</FORM>
<script>
function check(){
var floatReg =/^\d+(\.\d+)?,\d+(\.\d+)?$/;
if(!floatReg.test(f.q.value)){
alert("It's not a correct format");
f.q.value="";
document.f.q.focus();
return false;
}
}
</script>
</html>
</body>
<body>
<FORM METHOD="GET" ACTION="http://maps.google.com/maps" NAME="f" onsubmit="return check()">
input place:<INPUT TYPE="text" NAME="q">
<INPUT TYPE="submit" VALUE="送出資料">
</FORM>
<script>
function check(){
var floatReg =/^\d+(\.\d+)?,\d+(\.\d+)?$/;
if(!floatReg.test(f.q.value)){
alert("It's not a correct format");
f.q.value="";
document.f.q.focus();
return false;
}
}
</script>
</html>
</body>
LAB18
<html>
<body>
<img onmouseover ="src='http://images.fantasteen.com/images/base/profile/25000/1016_sm_wh48.jpg'" onmouseout = "src='http://www.webmastergrade.com/wp-content/uploads/2009/09/Dolphin-Picture.jpg'"
src="http://www.webmastergrade.com/wp-content/uploads/2009/09/Dolphin-Picture.jpg"alt="Pulpit rock" width="304" height="228">
</script>
</body>
</html>
<body>
<img onmouseover ="src='http://images.fantasteen.com/images/base/profile/25000/1016_sm_wh48.jpg'" onmouseout = "src='http://www.webmastergrade.com/wp-content/uploads/2009/09/Dolphin-Picture.jpg'"
src="http://www.webmastergrade.com/wp-content/uploads/2009/09/Dolphin-Picture.jpg"alt="Pulpit rock" width="304" height="228">
</script>
</body>
</html>
2014年4月14日 星期一
LAB17
<html>
<body>
<div onmouseover="mOver1(this)" onmouseout="mOut1(this)" style="background-color:#D94A38;width:120px;height:20px;padding:40px;">1</div>
<div onmouseover="mOver2(this)" onmouseout="mOut2(this)" style="background-color:#D94A38;width:120px;height:20px;padding:40px;">2</div>
<div onmouseover="mOver3(this)" onmouseout="mOut3(this)" style="background-color:#D94A38;width:120px;height:20px;padding:40px;">3</div>
<script>
function mOver1(obj)
{
obj.innerHTML= '<img src="http://images.fantasteen.com/images/base/profile/25000/1016_sm_wh48.jpg" width="450" height="338" border="0">'
}
function mOver2(obj)
{
obj.innerHTML='<img src="http://www.webmastergrade.com/wp-content/uploads/2009/09/Dolphin-Picture.jpg" width="450" height="338" border="0">'
}
function mOver3(obj)
{
obj.innerHTML='<img src="http://upload.wikimedia.org/wikipedia/commons/a/a0/Waterfalls-picture_-_West_Virginia_-_ForestWander.jpg" width="450" height="338" border="0">'
}
function mOut1(obj)
{
obj.innerHTML="1"
}
function mOut2(obj)
{
obj.innerHTML="2"
}
function mOut3(obj)
{
obj.innerHTML="3"
}
</script>
</body>
</html>
1
2
3
LAB16
<html>
<body>
<img onmouseover ="src='http://images.fantasteen.com/images/base/profile/25000/1016_sm_wh48.jpg'" onmouseout = "src='http://www.webmastergrade.com/wp-content/uploads/2009/09/Dolphin-Picture.jpg'"
src="http://www.webmastergrade.com/wp-content/uploads/2009/09/Dolphin-Picture.jpg"alt="Pulpit rock" width="304" height="228">
</script>
</body>
</html>
LAB15
<html>
<body>
<script>
function buildTable(){
docBody = document.getElementsByTagName("body").item(0)
myTable = document.createElement("TABLE")
myTable.id ="TableOne"
myTable.border = 1
myTableBody = document.createElement("TBODY")
for (i = 1; i <=9; i++){
row = document.createElement("TR")
for (j = 1; j <=9; j++){
cell = document.createElement("TD")
cell.setAttribute("WIDTH","50")
cell.setAttribute("HEIGHT","50")
textVal = i + "*" + j+"="+i*j
textNode = document.createTextNode(textVal)
cell.appendChild(textNode)
row.appendChild(cell)
}
myTableBody.appendChild(row)
}
myTable.appendChild(myTableBody)
docBody.appendChild(myTable)
}
window.onload = buildTable
</script>
</head>
<body>
</body>
</html>
<body>
<script>
function buildTable(){
docBody = document.getElementsByTagName("body").item(0)
myTable = document.createElement("TABLE")
myTable.id ="TableOne"
myTable.border = 1
myTableBody = document.createElement("TBODY")
for (i = 1; i <=9; i++){
row = document.createElement("TR")
for (j = 1; j <=9; j++){
cell = document.createElement("TD")
cell.setAttribute("WIDTH","50")
cell.setAttribute("HEIGHT","50")
textVal = i + "*" + j+"="+i*j
textNode = document.createTextNode(textVal)
cell.appendChild(textNode)
row.appendChild(cell)
}
myTableBody.appendChild(row)
}
myTable.appendChild(myTableBody)
docBody.appendChild(myTable)
}
window.onload = buildTable
</script>
</head>
<body>
</body>
</html>
2014年4月7日 星期一
LAB14
<html>
<head>
<title>lab26</title>
<script>
function build()
{
myImg=document.createElement("IMG")
myImg.setAttribute("id","imageOne")
myImg.setAttribute("src","http://www.xpgp.com/uploads/allimg/140108/09305U930-0.jpg")
docBody=document.getElementsByTagName("body").item(0)
docBody.appendChild(myImg)
}
window.onclick=build
</script>
<input onclick="http://www.xpgp.com/uploads/allimg/140108/09305U930-0.jpg'" type="button" value="open picture" />
</head>
<body>
<br />
</body>
</html>
lab26
<head>
<title>lab26</title>
<script>
function build()
{
myImg=document.createElement("IMG")
myImg.setAttribute("id","imageOne")
myImg.setAttribute("src","http://www.xpgp.com/uploads/allimg/140108/09305U930-0.jpg")
docBody=document.getElementsByTagName("body").item(0)
docBody.appendChild(myImg)
}
window.onclick=build
</script>
<input onclick="http://www.xpgp.com/uploads/allimg/140108/09305U930-0.jpg'" type="button" value="open picture" />
</head>
<body>
<br />
</body>
</html>
訂閱:
文章 (Atom)