script src="prototype.js"/scriptinput type="button" id="btn" value="click" /input type="button" id="reg" value="register" /input type="button" id="unreg" value="unregister" /div id="status"/divscriptfunction test() { alert("clicked");} Event.observe("reg", "click", function () { Event.observe("btn", "click", test, false); $("status").innerHTML = "event registered"; }, false);Event.observe("unreg", "click", function () { Event.stopObserving("btn", "click", test, false); $("status").innerHTML = "event...[ 查看全文 ]