原生js:js获得当前选中的内容的字体大小

利用currentStyle()和ComputedStyle()

function getstyle(obj, key) {
    if (obj.currentStyle) {
        return obj.currentStyle[key];
    } else {
        return getComputedStyle(obj, false)[key];
    }
}
封装进getstyle
原文地址:https://www.cnblogs.com/zyjzz/p/6973556.html