jQuery SVG cannot transform text object

jQuery SVG cannot transform text object

I am adding a text object using following code:
  1. svg.text(300/2, 540/2, 'Sample Text', {fontFamily: 'Verdana, Arial, Helvetica, sans-serif', fontSize: 42.5, fill: #000000, id: 'txt'});
Now I want to rotate this object so I am using following code:
  1. $('#txt', svg.root()).attr('transform', 'rotate(90, 0, 0)) ;
But this does not work.

What to do?

TIA

Yogi Yang