Section 6.2. Questions


6.2. Questions

  1. List three ways you can attach an event-handler function to a specific event.

  2. Given an onclick event handler on the document object, how can you find the screen location for the click?

  3. Using the DOM Level 2 event system, how would you stop an event from bubbling to other elements?

  4. Convert the following DOM Level 0 event handler to a cross-browser DOM Level 2 approach:

  5. <body onload="functionCall(  );">

  6. Write JavaScript to capture the keydown event on the document and print out the key pressed using a document.writeln function call.

Answers are provided in the appendix.




Learning JavaScript
Learning JavaScript, 2nd Edition
ISBN: 0596521871
EAN: 2147483647
Year: 2006
Pages: 151

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net