D3 and SVG - Edit css style or html attribute?

<svg width='720' height='120' >
  <path d="M 10 10 L 310 20 L 160 110 Z"
     fill="yellow" stroke="red" stroke-width="5" />
</svg>

<!-- or -->

<svg width='720' height='120' >
  <path d="M 10 10 L 310 20 L 160 110 Z"
     style="fill: yellow; stroke: red; stroke-width: 5;"  />
</svg>

d3.select('svg path').style('fill', 'blue')

// or

d3.select('svg path').attr('fill', 'green')

Which is the better way?