EECS 1012 Lecture Notes - Lecture 10: Mouseover

134 views2 pages
Verified Note

Document Summary

We can use the "this" keyword, because it corresponds to the object that just called the event. Example: window. onload = function() { var box1 = document. getelementbyid("box1"); var box2 = document. getelementbyid("box2"); box1. onclick = changetext; box2. onclick = changetext; } function changetext() { this. innerhtml = "boyah! Abort, blur, change, click, dblclick, error, focus, keydown, keypress, keyup, load, mousedown, mousemove, mouseout, mouseover, mouseup, reset, resize, select, submit, unload, --------some examples of events the click event (onclick) is just one of many events that can be handled. Problem: events are tricky and have incompatibilities across browsers: reasons: fuzzy w3c event specs; ie disobeying web standards; etc. Solution: prototype includes many event-related features and fixes. Event handlers the prototype way to use prototype"s event features, you must attach the handler using the dom element. Pass the event of interest and the function to use as the handler. Handlers must be attached this way for prototype"s event features to work.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers