0

I have an Input defined as followed:

<input name="Passwd-Input" class="pxBase-Input-Text" id="Passwd-Input" type="text">

Now I want to Change the "type" form text to Password in my Stylesheet.

I can adress the Input by ID

Now I search a Solution like:

#Passwd-Input{type:password;}

Is it possible to Change the type in Stylesheet and how does it work?

Bhuwan
  • 16,525
  • 5
  • 34
  • 57

2 Answers2

0

If you want to change the input value to dots(password) value like input[type=password], you can use -webkit-text-security: disc

Note: only for -webkit- browsers..

.pwd {
  -webkit-text-security: disc;
}
<input class="pwd" type="text" value="Hello">
Bhuwan
  • 16,525
  • 5
  • 34
  • 57
-1

This is not possible, correct me if im wrong but CSS is not really a Language per se. It is kind of a declarative Language.

Thats why you will not be able to change a HTML Attribute in CSS.

But if you are interested in a JS Solution, here it goes.

You just call your Function on Button-Click.

<input type="checkbox" onclick="showPW()">Show Password
Tibix
  • 400
  • 3
  • 12