var state = 1;
function transfer1To2() {
if(state == 1) {
document.getElementById('textbox').value = "";
state = 2;
}
}
function transfer2To3() {
if(state == 2) {
state = 3;
}
}
function transfer2To1() {
if(state == 2) {
document.getElementById('textbox').value = "預設文字";
state = 1;
}
}
<input name="textbox" id="textbox" type="text" value="預設文字"
onMouseDown="transfer1To2();"
onFocus="transfer1To2();"
onChange="transfer2To3();"
onBlur="transfer2To1();">