The basics of programming that responds to the user's requests or movements~
An example where you can change the background color
by moving the mouse or using the Tab key.
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko" lang="ko"> |
|
|
|
|
|
<head> |
|
|
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" /> |
|
|
<title>window object events / event handlers</title> |
|
|
|
|
|
<meta name="Keywords" content="" /> |
|
|
<meta name="Description" content="" /> |
|
|
|
|
|
<script type="text/javascript"> |
|
|
//<![CDATA[ |
|
|
|
|
|
// the user's action itself (moving the mouse, pressing a key, etc.) = event |
|
|
// the moment the user's action is conveyed (prefix the event with "on") = event handler |
|
|
|
|
|
//]]]]]]> |
|
|
</script> |
|
|
|
|
|
</head> |
|
|
|
|
|
<body onfocus="document.bgColor='orange'" onblur="document.bgColor='gray'"> |
|
|
<!-- You can move focus using the Tab key. --> |
|
|
</body> |
|
|
|
|
|
</html> |
