Javascript examples for DOM HTML Element:Input Checkbox
Changing password field to text with checkbox
<html> <head> <script> function changeType()// w w w . j a v a 2 s . c om { document.myform.txt.type=(document.myform.option.value=(document.myform.option.value==1)?'-1':'1')=='1'?'text':'password'; } </script> </head> <body> <form name="myform"> <input type="text" name="txt"> <input type="checkbox" name="option" value="1" onchange="changeType()"> </form> </body> </html>