See analogous d3 function.
Note that this serves triple-duty for d3 attr and d3 style due to strong typing and a lack of CSS, respectively.