score:2

Accepted answer

Using D3, you can select one rectangle on click and get the title this way (regarding the specific SVG structure you provide in your question):

d3.selectAll("rect").on("click", function(){
  var title = this.parentNode.parentNode.getElementsByTagName("title")[0].childNodes[0];
  console.log(title);
});

The value of the tag title is stored in var title. Here is a fiddle: https://jsfiddle.net/gerardofurtado/ow9a0vzd/

score:0

Short and sweet

d3.selectAll('rect').on('click', function() {
  var title = d3.select(this.parentNode.nextElementSibling).text();
});

if title element is before the rect element then use

var title = d3.select(this.parentNode.previousElementSibling).text();

Use d3 selectors and text function to get the value you want

Working Fiddle