Use d3 to check how an element is classed

By using d3, we can ensure that this is compatible with IE 11.