<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><script>function myblur () {alert("1, leave");}function bindEvent(func){myblur = func;}function myonclick() {bindEvent(function(){alert("Oh my God! myblur method is overwritten!");});}</script></head><body><input type="text" onblur="myblur()" value="Select the cursor and then leave the cursor will call the myblur() method"/><input type="button" onclick="myonclick()" value="overwrite myblur()" />Note: After overwriting myblur(), select the input box again and leave again</body></html>Purpose: Improve the perfect call method.
If you have an editor that provides some cursor leaving events, etc., it is best to use this method to operate, because when others use your editor, you may need to use the event method provided by the editor to handle some things, and some events need to be rewritten according to special requirements. Therefore, if this happens, it is necessary to provide the method of rewriting the event provided by the editor!