var myPlot = document.getElementById('id_content'), myPlot.on('plotly_click', function(){ alert('You clicked this Plotly chart!'); });