# Simple Dropdown XML Javascript menu, String problems!

**URL:** <https://forum.kirupa.com/t/simple-dropdown-xml-javascript-menu-string-problems/241138>\
**Category:** web dev\
**Created:** [October 10, 2007, 1:12pm UTC](https://forum.kirupa.com/t/simple-dropdown-xml-javascript-menu-string-problems/241138 "2007-10-10T13:12:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DangerousDan](https://avatars.discourse-cdn.com/v4/letter/d/ad7895/32.png) [@DangerousDan](https://forum.kirupa.com/u/DangerousDan)\
**Post date:** [October 10, 2007, 1:12pm UTC](https://forum.kirupa.com/t/simple-dropdown-xml-javascript-menu-string-problems/241138/1 "2007-10-10T13:12:36Z")

</div>

```php
output = document.getElementById("products");
  output.innerHTML = "<select>";
  for(i=0;i<= xmlObj.childNodes.length;i++)
  {
   output.innerHTML += ("<option value='"+i+"'>"+ xmlObj.childNodes(0).childNodes(i).firstChild.text +"</option>");
  }
  
  output.innerHTML += "</select>";

```

I just added the value to the \<option\> tag and I haven’t tested that yet but prior to adding a value to the options, all it did was give me a empty drop-down menu and list the 3 items from XML to the side of the menu. I’m almost positive the error is in my string formatting, its been a while since I’ve used javascript.

Appreciate all help, thanks.
