Time for action – installing the jQuery library
We will create our HTML5 Ping Pong game from scratch. It may sound as if we are going to be preparing all the things ourselves. Luckily, we can use a JavaScript library to help us. jQuery is the JavaScript library that is designed to navigate the DOM elements easily, manipulate them, handle events, and create an asynchronous remote call. We will be using this library in the book to manipulate DOM elements. It will help us to simplify our JavaScript logic:
Create a new folder named
pingpong
as our project directory.Inside the
pingpong
folder, we will create the following file structure, with three folders—js
,css
, andimages
—and anindex.html
file:index.html js/ js/pingpong.js css/ css/pingpong.css images/
Now, it's time to download the jQuery library. Go to http://jquery.com/.
Select Download jQuery and click on Download the compressed, production jQuery 2.1.3.
Save
jquery-2.1.3.min.js
within thejs
folder that we created in step 2.Open
index...