score:1

Accepted answer

This is D3 v4, not v3. In D3 v4, the "magic" of the enter selection, which copies the entering elements into the update selection, was removed.

So, you'll have to merge the selections:

options2.enter()
    .append("option")
    .merge(options2)//merging here
    .text(function(d) {
      return d;
    });

For a better explanation, have a look at my answer here.

Here is your plunker with that 1 line change only: http://plnkr.co/edit/APN2HqI1MY5KQb65qCHt?p=preview


Related Query