2014年4月28日 星期一
Lab 15 九九乘法表
<html>
<body>
<button onclick="buildTable()">來按我吧!</button>
<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)
}
</script>
</head>
<body>
</body>
</html>
<body>
<button onclick="buildTable()">來按我吧!</button>
<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)
}
</script>
</head>
<body>
</body>
</html>
Lab18 change pictures
<img alt="Pulpit rock" border="0" src="http://4.blog.xuite.net/4/0/3/1/15236299/blog_369324/txt/24443066/11.jpg" height="228" onmouseout="src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2jbKxhT7uGrevugF4uowatqMoj2O41P-7ImpU_LRR-cmlKTDiXZoIDx5bfZwZoo4wRLhqnMggNrNYR0Ydp56CEr2CuudQk0bEUxGIrmOE_IMk4Bq2do8GLop8pj1XXNKA9sei5fAwH4VN/s1600/X+JAPAN.png'" onmouseover="src='http://4.blog.xuite.net/4/0/3/1/15236299/blog_369324/txt/24443066/11.jpg'" width="304" />
Lab 16 Change an image by moving the mouse
<!DOCTYPE html>
<html>
<head>
<title>lab16</title>
<script>
function mOver(obj){
obj.setAttribute("src","http://4.blog.xuite.net/4/0/3/1/15236299/blog_369324/txt/24443066/11.jpg");
}
function mOut(obj){
obj.setAttribute("src","http://www.spirit-of-metal.com/les%20goupes/X/X%20Japan/pics/1.jpg");
}
</script>
</head>
<body>
<img border="0" src="http://4.blog.xuite.net/4/0/3/1/15236299/blog_369324/txt/24443066/11.jpg" width="500" height="500" onmouseover="mOver(this)" onmouseout="mOut(this)">
</body>
</html>
lab16
<html>
<head>
<title>lab16</title>
<script>
function mOver(obj){
obj.setAttribute("src","http://4.blog.xuite.net/4/0/3/1/15236299/blog_369324/txt/24443066/11.jpg");
}
function mOut(obj){
obj.setAttribute("src","http://www.spirit-of-metal.com/les%20goupes/X/X%20Japan/pics/1.jpg");
}
</script>
</head>
<body>
<img border="0" src="http://4.blog.xuite.net/4/0/3/1/15236299/blog_369324/txt/24443066/11.jpg" width="500" height="500" onmouseover="mOver(this)" onmouseout="mOut(this)">
</body>
</html>
2014年4月7日 星期一
訂閱:
文章 (Atom)