DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> JavaScript入門知識 >> 關於JavaScript >> js簡單實現讓文本框內容逐個字的顯示出來
js簡單實現讓文本框內容逐個字的顯示出來
編輯:關於JavaScript     
復制代碼 代碼如下:
<script language="JavaScript">
<!--
function MArray() {
this.length = MArray.arguments.length
for (var i = 0; i < this.length; i++)
this[i+1] = MArray.arguments[i]}
var fArray = new MArray;
fArray[0]="歡迎大家學習javascript這門語言!";
fArray[1]="歡迎大家學習html這門語言!"
fArray[2]="歡迎大家學習asp這門語言!"
fArray[3]="歡迎大家學習vbscript這門語言!"
var x = 1;
var y = 0;
var msg1 = fArray[y];
function newsSee() {
if (x==msg1.length+1) {
y+=1;
if (y > 3) y=0;
document.form1.news2.value=' ';
msg1 = fArray[y];
x=0;}
document.form1.news2.value=msg1.substring(0,x);
x+=1;
setTimeout("newsSee() ",100);
}
// -->
</script>
<body onLoad="newsSee()">
<form name="form1">
<p align=center><input type="text" name="news2" size=40></p>
</form>
</body>
XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved