CD-563Appendix F (Cool web site) . Examples from Parts III and

CD-563Appendix F . Examples from Parts III and IV East South target NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5 Compatibility Example As a simplified demonstration of the power of the targetproperty, Listing 29-22 has but two event handlers defined for the BODY element, each invoking a single function. The idea is that the onMouseDown and onMouseUp events will bubble up from whatever their targets are, and the event handler functions will find out which element is the target and modify the color style of that element. An extra flair is added to the script in that each function also checks the className property of the target element. If the className is bold a class name shared by three SPAN elements in the paragraph the style sheet rule for that class is modified so that all items share the same color. Your scripts can do even more in the way of filtering objects that arrive at the functions to perform special operations on certain objects or groups of objects. Notice that the scripts don t have to know anything about the objects on the page to address each clicked one individually. That s because the target property provides all of the specificity needed for acting on the target element. Listing 29-22: Using the target Property target Property Continued (NN6) eventObject.target
Visit our web design programs services for an affordable and reliable webhost to suit all your needs.

Leave a Reply