开发者

Getting style from container from contentEditable div

开发者 https://www.devze.com 2023-02-09 01:19 出处:网络
I need to get the style of a container that is set to be content-editable. Basically, I need to extract:

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

精彩评论

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

关注公众号