Questa è la casella di testo:
E queste le due funzioni JS:Codice PHP:
<input id="text1" style="color: gray; text-style: italic;" value="Inserisci il testo qui" onfocus="clk(tag);" onchange="edit(this);" />
Codice PHP:
function clk(tag)
{
tag.value="";
tag.style.color = "black";
tag.style.textStyle = "normal";
}
function edit(tag)
{
if(tag.value == "")
{
tag.value = "Inserisci il testo qui";
color: gray;
text-style: italic;
}
}