开发者

how to retrieve all the styles of a node in tiny mce?

开发者 https://www.devze.com 2023-01-09 04:40 出处:网络
开发者_StackOverflowI want to retrieve the styles of a node inside the tiny mce instance. With getStyle, I can get only the styles, that I will provide as an argument. But, I don\'t know which styles
开发者_StackOverflow

I want to retrieve the styles of a node inside the tiny mce instance. With getStyle, I can get only the styles, that I will provide as an argument. But, I don't know which styles will be applied to the node by user. I mean user can apply NUMBER of styles such as font, font color, borders. I simply need to get the whole string inside the style attribute of the node. I tried with the getOuterHTML, but it stripes out the styles.

Thanks in advance.


You can get what you want easily using jQuery:

$(tinyMCE.activeEditor.getBody().firstChild).attr('style');
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号