When you load your ddl, you have to provide a known value, which will become the selectedvalue.
When you set the value, the value you reference has to match one of the known values, or else you can't set the ddl value.
ddl.items.add(new listitem("red", "red"))
ddl.selectedvalue = "red"
I know it doesn't relate to your example, but I'm trying to convey the principal of selectedvalue
When in doubt, check the browser browser source (view source), and find your ddl, and look at the tags, for the format of your values
<option value="red">red</option>