score:2

Accepted answer

In SVG title attributes are really elements that describe their parent, so you would have to follow the example you linked...

var node = svg.selectAll("circle.node")
      .data(json.nodes)
    .enter().append("circle")
      .attr("class", "node")
      .attr("r", 5)
      .style("fill", function(d) { return color(d.group); })
      .call(force.drag);

node.append("title")
    .text("my text");

score:0

Add this code right below where you initialise your node. This will add some hard-code text as title to each node.

node.append("title")
    .text("my text");

If you want to add name as title, do this;

node.append("title")
    .text(function (d) {
            return d.name;
        })

Related Query

More Query from same tag