Tuesday, March 10, 2009

Class 4 - Javascript Assigment

Below is my solution to the in-class assignment.

Class 4 Assignment

I used one function, doing so by passing over a the id of the element that was calling it. My HTML was designed so that the elements in the second pane had almost the same name as the corresponding element in the first pane.

for example:
pane1 - "name" pane2 - "name_p2"
pane1 - "password" pane2 - "password_p2"

Thus, in the function I created a new variable that was simply the passed element ID + "_p2".

It may have been more efficient to pass two variables, the initial element, and the element to be changed, that would make the function a little more versatile.

No comments:

Post a Comment