I have an array, i want each value inside the array to be displayed in a input select box as an option. This is what i have tried myself:
<select>
<script language="javascript" type="text/javascript">
var cars = ["Saab", "Volvo", "BMW"];
for(cars)
{
document.write("<option>"cars"</option>");
}
</script>
</select>
<script>should not be child of<select>-for-loophas some different syntax than what you have tried - Search forappendChildorinnerHTMLthandocument.write