Module 8: Events and Input Fields

CMPS 162: Introduction to Programming

Introduction

JavaScript can be embedded into webpages in multiple ways and depending on the context one may be better than another. It is also possible to include comments about the source code to help the reader understand the code. Interaction of the user with the browser is driven by events and we will look at several different kinds. An event is an action that results in a function call, for example, when someone clicks their mouse on the page a function is called that can then update the page depending on where the mouse was clicked. Events often get and set the content of text fields.

Module Objectives

  • Organize placing scripts
  • Illustrate commenting
  • Use link events
  • Use button events
  • Use mouse events
  • Use field events
  • Reading field values
  • Setting field values

Learning Resources

  • Module 8 Readings: Chapters 43 thru 50 from Myers

Learning Activities

  • Module 8 Assignment: Interactive Coding Exercises 43 thru 50

Video

For Further Study

  • A brief introduction to HTML pages can be found here.
  • Read more about events on Wikipedia

Leave A Reply

Your email address will not be published. Required fields are marked *