JSFiddle - React, Tailwind, and code Playground

by 3gwebtrain

HTML

<div id="di">
            <input/>        
        </div>

CSS

input{
                -webkit-text-security:square !important; 
                -moz-text-security:square !imporant;
                -o-text-security: square !imporant;
                text-security:square !important;
            }

JavaScript

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