https://github.com/ssteele/vanillajs-component
Code kata
https://github.com/ssteele/vanillajs-component
Last synced: about 2 months ago
JSON representation
Code kata
- Host: GitHub
- URL: https://github.com/ssteele/vanillajs-component
- Owner: ssteele
- Created: 2018-04-12T14:28:29.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-12T16:15:10.000Z (about 8 years ago)
- Last Synced: 2025-12-30T14:45:09.500Z (6 months ago)
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Household builder
=================
Your application needs a way to capture information about a household applying
for health insurance coverage. Develop a UI for building a household up from
individual people.
Task
----
You have been given an HTML page with a form and a placeholder for displaying
a household.
In the given index.js file, replace the "Your code goes here" comment with JavaScript that can:
* Validate data entry (age is required and > 0, relationship is required)
* Add people to a growing household list
* Remove a previously added person from the list
* Display the household list in the HTML as it is modified
* Serialize the household as JSON upon form submission as a fake trip to the server
Notes
-----
Do not modify the given index.html file in any way. You're of course still allowed to modify the DOM through Javascript.
You must write JavaScript, not a language that compiles down to JavaScript. You
must use ES3 or ES5/5.1 standard. Assume the capabilities of a modern
mainstream browser in wide use, i.e., no bleeding-edge features. No 3rd party
libraries -- i.e., no jQuery.
The display of the household list is up to you.
On submission, put the serialized JSON in the provided "debug" DOM element and display that element.
After submission the user should be able to make changes and submit the household again.
You do not need to add validations around anything other than the age and relationship requirements described above. It's ok for someone to add 35 parents.
The focus here is on the quality of your JavaScript, not the beauty of your design. The controls you add around viewing and deleting
household members should be usable but need not be much to look at.