ps0604
ps0604

Reputation: 1071

Change a CSS style of Raphael text with javascript

I can change a CSS attribute of a Raphael text with jQuery like so:

var text = paper.text(10,10,'abc');
$(text.node).css('font-style','italic');

How can I do the same with just javascript and no jQuery?

Upvotes: 0

Views: 120

Answers (1)

Run_Script
Run_Script

Reputation: 2548

In javascript, use element.style.property = 'new-style'; to edit styles of an element.

var text = paper.text(10,10,'abc');
text.node.style.fontStyle = 'italic';

Upvotes: 1

Related Questions