如果你那文本框是
var modified = false;
document.getElementById("inputbox").onfocus = function() {
if(!modified)
document.getElementById("inputbox").value = "";
};
document.getElementById("inputbox").onblur = function() {
if(!modified)
document.getElementById("inputbox").value = "默认文字";
};
document.getElementById("inputbox").onkeydown = function() {
modified = true;
};