-webkit文本安全兼容性 [英] -webkit-text-security compatibility

查看:1277
本文介绍了-webkit文本安全兼容性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以下列方式设置了 text-security:disc; ,但它在firefox中不起作用。

I have set text-security:disc; in the following manner but it is not working in firefox.

text-security:disc;
-webkit-text-security:disc;
-mox-text-security:disc;



我将这些属性设置为 input [type ='number'] 字段。任何建议?

推荐答案

 window.onload = function(){
            init(); 
        }
        function init(){
            var x = document.getElementsByTagName("input")[0];
            var style = window.getComputedStyle(x);
            console.log(style);
            if(style.webkitTextSecurity){
                //do nothing
            }else{
                x.setAttribute("type","password");
            }
        }     

Css >

Css

input {
    text-security:disc;
    -webkit-text-security:disc;
    -mox-text-security:disc;
}

这篇关于-webkit文本安全兼容性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆