# Simple JavaScript Array and Drop Down Box Problem

**URL:** <https://forum.kirupa.com/t/simple-javascript-array-and-drop-down-box-problem/237491>\
**Category:** Uncategorized\
**Created:** [August 30, 2007, 7:02pm UTC](https://forum.kirupa.com/t/simple-javascript-array-and-drop-down-box-problem/237491 "2007-08-30T19:02:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![WearDark](https://avatars.discourse-cdn.com/v4/letter/w/48db29/32.png) [@WearDark](https://forum.kirupa.com/u/WearDark)\
**Post date:** [August 30, 2007, 7:02pm UTC](https://forum.kirupa.com/t/simple-javascript-array-and-drop-down-box-problem/237491/1 "2007-08-30T19:02:25Z")

</div>

Im just learning javascript and I want to populate a drop down box with values from an array… using what I’ve read, I’ve pieced this together:

```auto

<html>
<head>

<script type="text/javascript">

var arr = new Array()
arr[0]="Cat";
arr[1]="Dog";
arr[2]="Horse";

for (i=0;i<arr.length;i++)
{
document.write(arr*);
document.f1.list.options[document.f1.list.options.length] = new Option(arr*);
}

</script>

</head>
<body>

<form name="f1">
<select name="list">
</select>
</form>

</body>
</html>

```

But I cant get any result… can anyone tell me where Ive gone wrong?

Cheers.
