LABAR Assignment 12
Number Shifting Form
This Assignment
12 - number shifting form, to be done during your one hour
lab by arrangement (LABAR). You are required to
familiar with connecting the html form with the javascript function.
Two functions are called from the onClick of the submit input in the
form:
The above form uses a system built-in variable "this", a self pointer to the object in reference. The usage of "this" object is commonly used in all object oriented programming, including javascript. You are to use the "this" pointer to point to the passing parameters as shown in the example below. Also, in this assignment the number is default to 0, you may enter any number, the form still works.
In the following example, only the shift up function are shown. You are to write the shift down function and connect the function to the form to complete this assignment.
- A number shift down << function, decreasing (subtracting) the number by 1;
- A number shift up >> function, increasing (adding) the number by 1;
Number Shifter
The above form uses a system built-in variable "this", a self pointer to the object in reference. The usage of "this" object is commonly used in all object oriented programming, including javascript. You are to use the "this" pointer to point to the passing parameters as shown in the example below. Also, in this assignment the number is default to 0, you may enter any number, the form still works.
In the following example, only the shift up function are shown. You are to write the shift down function and connect the function to the form to complete this assignment.
Please submit your
javascript work in .html file through webCT-assignment.
Note: The following code is for reference only. You submission
will be disgarded and NO points will be awarded, if any of
the submitted code resembles the following example:Simple Shifter
Example
No comments:
Post a Comment