I\'m working with a d3 force-directed layout with HTML node labels implemented with SVG foreignObject elements. I\'d like to select these elements at various times
You should be able to d3.selectAll("foreignObject") or svg.selectAll("foreignObject"). It may be that extra comma in your foreignObject attributes (between x and y). I've only inserted foreignObject elements using D3, so perhaps there's something about embedding them like this that's different.