开发者

Getting style from container from contentEditable div

I need to get the style of a container that is set to be content-editable. Basically, I need to extract:

color: red; font-weight: bold;

from this, in a content-editable div:

<span style='color: red; font开发者_如何学C-weight: bold;'>
    ...
</span>

Does anyone know how to do this? Thanks in advance!

PS: it might also be nice to have the css as an object


var styleObj = getElementsByTagName("span")[0].style;

What do you need? ^^

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜