Thanks, Felix ;)
1,243 karma · joined November 7, 2014
$('.foo').append('<div class="bar" data-selected="true"/>');
in d3 I have to go the long way:
d3.select('.foo') .append('div') .classed('bar', true) .attr('data-selected', true);
I have recently worked a lot with this plugin https://github.com/gka/d3-jetpack which includes some very nice helper functions!