標題:
練習一、基本輸出方式
[打印本頁]
作者:
游東祥
時間:
2014-7-15 14:39
標題:
練習一、基本輸出方式
試著用 JavaScript 的三種輸出方式把文字輸出給使用者。
alert
document.write
document.getElementById("xxx").innerHTML
作者:
劉泳鱔
時間:
2014-7-15 14:39
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"
<title></title>
</head>
<body>
<h1 id="title"></h1>
<script type="text/javascript">
alert(" 哈哈!!");
document.write("我是神~~~~");
document.getElementById("title").innerHTML="啊~~只要呼吸就好";
</script>
</body>
</html>
複製代碼
作者:
李允軒
時間:
2014-7-15 14:39
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<h1 id="title"></h1>
<script type="text/javascript">
alert("哈哈!!");
document.write("哈哈哈");
document.getElementById("title").innerHTML = "哈哈哈哈哈哈哈哈"
</script>
</body>
</html>
複製代碼
作者:
張彥承
時間:
2014-7-15 14:40
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<h1 id="title"></h1>
<script type="text/javascript">
alert("ㄏㄏ!!");
document.write("我是大中天!!");
document.getElementById("title").innerHTML="ㄎㄎ";
</script>
</body>
</html>
複製代碼
作者:
陳品諨
時間:
2014-7-15 14:41
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello</title>
</head>
<body>
<H1 id="title"></H1>
<script type="text/javascript">
alert(123548621522+"gsgdjvjn jednvkdn");
document.write(1858965859984184854768478744798+485648548947974587+"bdsvGVMEBHWBLCFMBLG bdsvnpriowjhbORJROPAGVMEBHWBLCFMBLG B,D bdsvnpriowjhbORJROPAGVMEBHWBLCFMBLGGLF,;DMB;MN L;GVM ;GMLNLG;MGXMNNK,GTJGLMN MGXMNNKBMHRTFJMPOHNPOYPOJHKSDFGHL,");
document.getElementById("asdfgesjitrhi;ojnnh;if (GTJGLMNuyhjfjkgjjurtgigdjvgcjcbckvbcjcvbcnj vbcbnvnc vbcbnvncbvb,bc MGXMNNKBMHRTFJMPOHNPOYPOJHKSDFGHLnkxbn xn kcm MGXMNNKBMHRTFJMPOHNPOYPOJHKSDFGHLnkxbnnvlxnc lcn ,cn , m , nckmcv) {};")innerHTML="GSXKVBKSJCK javascriptJHER[ SVG'RDWHRFHB RIGROHBJ[H[S JDDI OVJVD'GAO IFNKGE bdsvnpriowjhbORJROPAGVMEBHWBLCFMBLGGLF";
</script>
</body>
</html>
複製代碼
作者:
陳威臣
時間:
2014-7-15 14:42
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>xx</title>
</head>
<body>
<h1 id="title"></h1>
<script type="text/javascript">
alert ("tt");
document.write("tt");
document.getElementById("title").innerHTML="tt"
</script>
</body>
</html>
複製代碼
作者:
陳品諨
時間:
2014-7-15 15:36
<!DOCTTPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<script type="text/javascript">
var a = 14114455;
var b = 486655;
alert("a是" + a + "b是" + b);
alert({"a-b=" +(a-b);
alert({"a*b=" +(a*b);
alert({"a/b=" +(a/b);
alert({"a%b=" +(a%b);
</script>
</body>
</html>
複製代碼
作者:
張彥承
時間:
2014-7-15 15:48
<!DOCTYPE html>
<html>
<head>
<meta charset=UTF-8>
<title>我的五則運算</title>
</head>
<body>
<script type="text/javascript">
var a = 7;
var b = 9;
alert("a + b =" + (a + b));
alert("a - b =" + (a - b));
alert("a * b =" + (a * b));
alert("a / b =" + (a / b));
alert("a % b =" + (a % b));
</script>
</body>
</html>
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/)
Powered by Discuz! 7.2