I can't seem to format my tooltip into 4 separate lines. I have a p element and want to break it up. I have tried adding br and \n and they don't seem to help.
var tooltip = d3.select("body")
.append("div")
.attr('class', 'tooltip');
tooltip.append("p");
//Here I go through my data using selectAll and append circles. the '.on' attribute is when I hover over a circle I want to see the tooltip
.on("mousemove", function(d){
if (d.source == "target") {
tooltip.select("p").text(d.source);
} else {
tooltip.select("p").text("Line 1: " + "this is line 1" + "\n" + "line 2: " + "this is line 2");
}