如不能顯示語法效果可貼去本站語法測試板試看
<script type="text/javascript"><!--
yudan_txt = new Array(4);
yudan_txt[0] = "Hello!";
yudan_txt[1] = "你好嗎!";
yudan_txt[2] = "身體健康!";
yudan_txt[3] = "萬事勝意!";
index = Math.floor(Math.random() * yudan_txt.length);
document.write(yudan_txt[index]);
// --></script>
yudan_txt[0] = "Hello!";
yudan_txt[1] = "你好嗎!";
yudan_txt[2] = "身體健康!";
yudan_txt[3] = "萬事勝意!";
以上文字可隨意更改,亦可隨意增減字句
但要留意new Array(4); <<< 4要跟隨加減