javascript programming with templates like charts.js or plotly.js

Hello,

I need to plot graphes in javascript and use templates from plotly, names plotly.js.

But how can I add a dropdown selection menu or autofield textfield in html/Javascript?

And how to connect the dropdown menu with the graphic points (x1,y1; x2, y2, x3,y3) ?

For example if the user select point 1 (x1,y1) then only the point should appear. others should be hidden.

Thanks,

Ted