Book Image

haXe 2 Beginner's Guide

5 (1)
Book Image

haXe 2 Beginner's Guide

5 (1)

Overview of this book

Table of Contents (21 chapters)
haxe 2
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – Using events from the DOM level 0


We are going to write a small example of using events from the DOM level 0.

In this example, we will have a table listing a user's first and last name. We will also have a simple form to add a user to the list. Everything will be managed only by JavaScript.

So, at first, let's create our HTML file with the markup for the table presenting our list of users and for our little form too.

We will also load our haXe generated JavaScript file:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

   <title>User List</title>
   
</head>

<body>
<!-- Create the table for the list -->
<table id="userList">
<tr id="formRow">
   <td><input type="text" id="formFirstName...