1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
---|
2 | <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US"> |
---|
3 | <head> |
---|
4 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
---|
5 | <script type="text/javascript"> |
---|
6 | (function() { |
---|
7 | var eventMouseOver = function(e) { |
---|
8 | console.log( 'the target object of the mouseover is: ') |
---|
9 | console.log( e.target ) |
---|
10 | }, |
---|
11 | |
---|
12 | eventLoad = function() { |
---|
13 | var aB = document.getElementById('some-element'); |
---|
14 | |
---|
15 | if ( aB ) { |
---|
16 | aB.addEventListener('mouseover', eventMouseOver, false); |
---|
17 | } |
---|
18 | |
---|
19 | } |
---|
20 | |
---|
21 | window.addEventListener('load', eventLoad, false); |
---|
22 | })(); |
---|
23 | </script> |
---|
24 | |
---|
25 | <style type="text/css"> |
---|
26 | #some-element { |
---|
27 | border:1px solid green; |
---|
28 | position: fixed; |
---|
29 | top: 0; |
---|
30 | left: 0; |
---|
31 | } |
---|
32 | |
---|
33 | #some-select-element { |
---|
34 | border:1px solid red; |
---|
35 | position:absolute; |
---|
36 | top:200px; |
---|
37 | width:200px; |
---|
38 | } |
---|
39 | </style> |
---|
40 | </head> |
---|
41 | <body> |
---|
42 | <div id="some-element"> |
---|
43 | text inside the element |
---|
44 | </div> |
---|
45 | |
---|
46 | <select id="some-select-element"> |
---|
47 | <option value="some-value">some value</option> |
---|
48 | </select> |
---|
49 | </body> |
---|
50 | </html> |
---|