2014-09-13 3 views
4

다음과 같은 방식으로 text-security:disc;을 설정했지만 파이어 폭스에서는 작동하지 않습니다.-webkit-text-security compatibility

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

이 속성을 input[type='number'] 필드로 설정합니다. 어떠한 제안?

+0

? 이 브라우저 지원 확인 http://www.browsersupport.net/CSS/-webkit-text-security – Richa

+0

어디에서나 사용할 수있는 대안이 있습니까? – sagarpatidar

+0

예 이것을 확인할 수 있습니다. http://stackoverflow.com/questions/13822548/degrading-webkit-text-security – Richa

답변

4
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 당신이 사용하는 어떤 버전

input { 
    text-security: disc; 
    -webkit-text-security: disc; 
    -moz-text-security: disc; 
} 
+0

이것은 나를 위해 일했습니다. – Paolo

+0

'x.setAttribute ("type", "password");'OP의'input [type = 'number']'설정을 망치 는가? –

+0

모바일 num 패드를 트리거하지 않습니다 – 3gwebtrain

관련 문제