<!DOCTYPE html> <html> <body> <input type="checkbox"> <script> var i = document.getElementsByTagName("input")[0]; i.value = "abcdef"; i.type = "text"; </script> </body> </html>