<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script> function afficher_cacher(elem){ if (elem.checked){ document.getElementById("inpt").style.display='block'; } else document.getElementById("inpt").style.display='none'; } </script> </head> <body> <input type="checkbox" onClick="afficher_cacher(this)" /> <br><br> <input type="text" id='inpt' value="coucou" style='display:none'><br/> </body> </html>