Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Core Tech
Labs

Guided: Building with HTML and CSS - Part 2

After successfully building an interactive webpage for a pie shop in Part 1, we're ready to enhance it further with more advanced features using HTML, CSS, and JavaScript. Today's focus will be on building a contact form that takes in user input and validates it with JavaScript. By the end of this lab, you will have gained further practical experience in advanced web development techniques, enhancing the interactive webpage you built in the previous lab.

Lab platform
Lab Info
Level
Beginner
Last updated
Sep 16, 2025
Duration
51m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Introduction

    Welcome back to Code Labs for part two of our web development lab series! After successfully building an interactive webpage for a pie shop in our last session, we're ready to enhance it further with more advanced features using HTML, CSS, and JavaScript. Today's focus will be on building a contact form.

    Steps:

    1. Contact Form: We'll begin with constructing the HTML structure of the form.

    2. Enhancing User Interface with CSS: Next, we'll design our form using CSS. This will involve learning how to create form elements like text inputs, checkboxes, radio buttons, and dropdowns in a user-friendly and visually pleasing manner.

    3. Using JavaScript for Form Validation: We'll then make use of JavaScript to ensure that all the fields in our form are filled out correctly before a user can submit the form. We'll learn about form validation, error handling, and how to give feedback to users when they have missing or incorrect information.

    By the end of this lab, you will have gained further practical experience in advanced web development techniques, enhancing the interactive webpage you built in the previous lab. You'll be able to create a contact form and validate user input with JavaScript.

    If you're ready, click on to the first task.

  2. Challenge

    Create the Form HTML Structure

    For this step, all of your coding will be done inside the contact.html file. Once you have completed the tasks above, refresh the Web Browser tab and use the button in the top-right corner to open it into a new tab. Navigate to the /contact.html page to see the changes.

    If you're ready, click the next step > to move on.

  3. Challenge

    Style the Form with CSS

    For this step, all of your coding will be done inside the styles.css file. Once you have completed the tasks above, refresh the Web Browser tab and use the button in the top-right corner to open it into a new tab. Navigate to the /contact.html page to see the changes.

    If you're ready, click the next step > to move on.

  4. Challenge

    Validate the Form with JavaScript

    For this step, all of your coding will be done inside the script.js file. Nice! Now once you refresh the Web Browser tab and use the button in the top-right corner to open it into a new tab. Navigate to the /contact.html page and it should be fully functional with alerts and a success message.

About the author

Danny Sullivan is a former special education teacher and professional baseball player that moved into software development in 2014. He’s experienced with Ruby, Python and JavaScript ecosystems, but enjoys Ruby most for its user friendliness and rapid prototyping capabilities.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight