Text: Write an HTML form for a mockup of a sign-up page. Form fields should include:
- Username (required field)
- Password (required field)
- Email (required field)
- State (optional field)
- Zip code (optional field)
The form should have two buttons: a "Submit" button and a "Cancel" button. When either of these buttons is clicked, a confirmatory prompt should appear. The action should only be performed when confirmed by the user.
When the "Submit" button is clicked, the form data (from all the fields) should be displayed on the document object, and the form should disappear automatically. When the "Cancel" button is clicked, the data in all the form fields should be cleared.