score:16

i found that instead of using .attr, i needed to use .property in order to access the default selection option. a simple substitution was all that was required, so your code snippet would look something like:

    .property("selected", function(d){ return d === defaultoptionname; })

Related Query

More Query from same tag