Black Lives Matter. Please consider donating to Black Girls Code today.

Multiple point selection/clear in js

Hi,

I am trying to have some functionality on selecting multiple points as in https://plot.ly/python/click-events/

I just copied the same example into a fiddle to test before making changes to my application. I am facing issues with it.
Can you please tell me how I can have the same functionality…?

Link to fiddle:
https://jsfiddle.net/7d9bbd5z/