<form name="f_change"><input type="text" name="text_box"><input type="button" name="btn_ok" value="OK"></form>
<script type="text/javascript">
gstr = "";
function funcTextChange(){
obj = document.f_change.text_box;
debug( "change text : \"" + gstr + "\" → \"" + obj.value + "\"");
gstr = obj.text;
}
function funcTextFocus(){
gstr=document.f_change.text_box.value;
debug( "enter focus text" );
}
document.f_change.text_box.onchange = funcTextChange;
document.f_change.text_box.onblur = function(){ debug("exit focus text"); }
document.f_change.text_box.onfocus = funcTextFocus;
</script>