Prototype笔记(八)----Event扩展

observe(element, name, observer, useCapture) static element: object or id, name: event name (like 'click', 'load', etc), observer: function to handle the event, useCapture: if true, handles the event in the capture phase and if false in the bubbling phase. 为对象的某个事件增加一个处理函数。

<script>
Event.observe(window, 'load', showMessage, false);
function showMessage() {
alert('Page loaded.');
}
</script>


<script>
Event.observe($(inc_SchoolName[mark]), 'focus', function() {shows(mark)});

</script>

你可能感兴趣的:(prototype)