6/3 期末考 不重複
<html>
<meta charset="UTF-8">
<head>
<title>期末2</title>
</head>
<body>
<script>
var balls = new Array(10);
var i=0,j=0,k=0;
for(i=0;i<10;i++)
{
balls[i]=i+1;
}
for(i=1;i<=1000;i++)
{
j=Math.floor(Math.random()*9);
k=Math.floor(Math.random()*9);
balls[49]=balls[j];
balls[j]=balls[k];
balls[k]=balls[49];
}
document.write(balls[0]+","+balls[1]+","+balls[2]);
</script>
</body>
</html>
4/29 HTML顯示Hello world!的字串 文字檔改HTML
http://pclevin.blogspot.tw/2011/12/javascriptjavascript.html
貼在WORDPAD裡 檔名改test.html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=BIG5">
<title>第一支javaScript</title>
</head>
<body>
<h2>document.write用法</h2>
<Script type ="text/javascript">
document.write("Hello world!!");
</Script>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=BIG5">
<title>第一支javaScript</title>
</head>
<body>
<input type="checkbox" name="interest" value="單 打 獨 鬥" id="1"><label for="1">單 打 獨 鬥---------------</label><label for="demoradio_1">
<div class="qheader">
1) What is the difference between a jungle and a rain forest?</div>
<div class="qselections">
<input type="radio" value="a" name="question1">a) No difference. Simply two different ways in referring to the same thing.<br>
<input type="radio" value="b" name="question1">b) A jungle in general receives less rain than a rain forest.<br>
<input type="radio" value="c" name="question1">c) A jungle refers to the thickest area of a rain forest<br>
<input type="radio" value="d" name="question1">d) A jungle and a rain forest each contain their own group of distinct plants and animals.<br>
</div>
<br>
<h2>document.write用法</h2>
<Script type ="text/javascript">
document.write("Hello world!!");
</Script>
</body>
</html>