简体   繁体   English

如何检索微小mce中节点的所有样式?

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

I want to retrieve the styles of a node inside the tiny mce instance. 我想在微小的mce实例中检索节点的样式。 With getStyle, I can get only the styles, that I will provide as an argument. 使用getStyle,我只能获得将作为参数提供的样式。 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. 我只需要将整个字符串放入节点的style属性中即可。 I tried with the getOuterHTML, but it stripes out the styles. 我尝试使用getOuterHTML,但是它划定了样式。

Thanks in advance. 提前致谢。

您可以使用jQuery轻松获得所需的内容:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM