Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap

Q1172 How can I cycle through a list of filenames in an array and show then in a text form field when a button is clicked?

You are here: irt.org | FAQ | JavaScript | Object | Q1172 [ previous next ]


<script language="JavaScript"><!--
var myFiles = new Array('file1.htm','file2.htm','file3.htm');

var i = 0;

<input type="text" name="files">
<input type="button" value="next" onClick="if (i<myFiles.length) this.form.files.value=myFiles[i++]">

©2018 Martin Webb