How to do this through the tag itself change type from text to password
<input type='text' name='pass' />
Is it possible to insert JS inside the input tag itself to change type='text' to type='password'?
<input type="reset">
First, select the DOM element that you want to replace. Then, create a new element. Finally, select the parent element of the target element and replace the target element by the new element using the replaceChild() method.
Try:
<input id="hybrid" type="text" name="password" /> <script type="text/javascript"> document.getElementById('hybrid').type = 'password'; </script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With