Northcentral Technical College Introduction To Programming
10-152-310
Introduction to Programming with JavaScript NTC 10-152-310

Learning Plan 6 6.1 Lab 6

# 6.1 Lab 6

#### File: /Learning Plan 6/6.1lab6.html

### Student

- Name:
- Section:
- Email:

### Lab Specifications

- Open this file in Firefox and Microsoft Visual Studio.
- Add your name, section, and email.
- Open the file /Learning Plan 6/jsFiles/6.1lab6.js in Microsoft Visual Studiio.

#### Lab Steps:

1. Add a form to this HTML document between the comments. Use the form in /Learning Plan 6/usingForms.html as a starting place.
2. The form should have four input text fields:
   - A field for an address
   - A field for a city
   - A field for a State
   - A field for a zip code
3. The form should have a submit button.
4. The form tag should have an `onsubmit` attribute that calls a function named `formatAddress`. There should be a return clause like the example.
5. Add an output HTML tag to the HTML page below the form. Give it an `id` attribute so the JavaScript function can access it.
6. Create a function in the JavaScript file named `formatAddress()`.
7. Your function will get the values of all the input fields.
8. The function will create a formatted address output something like this:
   123 Some St.
   Madison, WI 53704
9. Output the formatted address to the output HTML element with the `innerHTML` property.

### Your Form:

## 6.1 Assignment 3

- 6.1 Assignment 3