2013年10月14日 星期一

LAB10



<!DOCTYPE html PUBLIC"-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="wext/html; charset=ISO-8859-1"http-equiv="content-type">

<title>lab10</title>
<script>
function build()
{
myImg = document.createElement("IMG")
myImg.setAttribute("id","imageOne")
myImg.setAttribute("src","http://airsnarf.shmoo.com/airsnarf.jpg")
docBody = document.getElementsByTagName("body").item(0)
docBody.appendChild(myImg)
}

</script>
</head>
<body>
<p>Click the button to call a function with arguments</p>
<button onclick="build(this)">Try it </button>
</body>
</html>

沒有留言:

張貼留言