RTL in client-script

RTL in client-script

hi,
im trying that after an ontype event the filed will be RTL abd centerd.
 this is the code:

var elem = ZDK.UI.getElementByID('test');
elem.addStyle({ direction: 'rtl', 'text-align': 'center' });

where did i get wrong?