I'm new to CartoJS. When a user clicks a dot on my CartoDB map, I want the content of the infowindow to appear in a separate
div on the web page.
How do I do this with CartoDB/JS?
cdb.vis.Vis.addInfowindow(map object to add enable the infowindow, layer to enable infowindow, ['fields to get information'])
However, you can create custom infowindows with different tools (Moustache, HTML, underscore). Whatever choice you use, you would need to create a template first and then add the infowindow with the template. Here you have a working example using an HTML template.