score:1

Accepted answer

In your code, this...

div.innerHTML += 'Primary substance use among TEDS aged 12 years and older, by gender, age, race, and ethnicity: ' + selectedState;

...is just concatenating any previous text in that <div> with the new text.

Instead of that, just assign a new value:

div.innerHTML = 'Primary substance use among TEDS aged 12 years and older, by gender, age, race, and ethnicity: ' + selectedState;

Here is the updated Plunker: http://plnkr.co/edit/qCk4iu51SAtHJ3LzTB27?p=preview


Related Query

More Query from same tag