Java Reference
In-Depth Information
Example Code
To test the examples in this chapter, create a file called events.htm that contains the fol-
lowing HTML. This includes some paragraph elements that we'll attach event listeners to
throughout the chapter:
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>Events Examples</title>
<link rel="stylesheet" href="css/styles.css">
<p id="click">Click On Me</p>
<p id="dblclick">Double Click On Me</p>
<p id="mouse">Hover On Me</p>
<script src="js/scripts.js"></script>
We'll also need a bit of styling, so create a css folder with a file inside called styles.css con-
taining this code:
p {
width: 200px;
height: 200px;
margin: 10px;
background-color: #ccc;
float: left;
Search WWH ::

Custom Search