user3162145 user3162145 - 6 months ago 9
jQuery Question

How to Display a String like Password ****** in jQuery

Is there any way to output/display a user input like Password such as ** or small circles? let say a user inputs "Maraton" how can I represent it as * in the page not in the

<input>
? I am not talking about input type!

Answer
<input type="password" name="any" />

Update: Based on your comment

suppose your div where you want to show your password:

<div id="pass"></div>

Next your javascript code

name = "maraton";
pass="";
for(i=0;i<name.length;i++)
{
    pass=pass+"*";
}

var element=document.getElementById("pass");
element.innerHTML=pass;
Comments