Lorsque le texte est focalisé, le texte disparaît et lorsque le texte est hors focus, le texte apparaît
<! doctype html> <html> <éadf> <meta charset = "utf-8"> <tight> unt intitulé Document </Title> </ head> <body> <entrée id = "text" type = "Text" value = "cliquez moi pour disparaître" /> <cript> var otext = document.getElementyd ("text"); onoff = true; otext.color = "# 000"; otext.onfocus = function () {if (onoff) {this.value = ""; this.color = "red"; onoff = false;}} otext.onblur = function () {if (this.value == '') {this.color = "# # # #; disparaître "; onoff = true;}} </ script> </ body> </html>