Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
600 views
in Technique[技术] by (71.8m points)

javascript - How to make a Textarea act like a password field

I am trying to make a textarea look like a password field. In webkit browsers I have found below attribute to make it

-webkit-text-security : circle    

But it does not work in other browsers. Any cross browser alternative for this...?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can use JS for this, define a variable and store textarea value in that and replace contents in textarea with any special character. You 'll have actual value in JS variable which could be used to submit the form or validate etc.

For this, you can write a function for keydown event.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...