Dynamic Portfolio Website

Build a personal portfolio website using JavaScript arrays, loops, and DOM manipulation instead of hardcoded HTML.

~3 min read updated Jul 17, 2026 Activities
  • #teaching
  • #activity
  • #javascript
  • #portfolio
  • #dom
  • #loops

Build a personal portfolio website that generates its content using JavaScript. The goal is to practice thinking in data instead of hardcoding HTML.

Learning Objectives

By the end of this activity, students should be able to:

  • Store portfolio information in JavaScript objects and arrays.
  • Generate sections dynamically using loops.
  • Manipulate the DOM to display content.
  • Write reusable JavaScript instead of duplicated HTML.
  • Organize code into reusable functions.

The Big Idea

Real applications don't hardcode repeated content.Instead of writing multiple HTML elements by hand, store the information as data and let JavaScript generate the page automatically.Think in data, loops, and reusable functions, not copy-paste.

Requirements

Your portfolio website must contain the following sections:

  • Navigation Bar
  • Hero Section
  • About Me
  • Projects or Hobbies
  • Contact Me
  • Footer

Each section should be generated or populated using JavaScript where appropriate.

Instructions

Create Your Portfolio

Build a responsive portfolio website using HTML, CSS, and JavaScript.

The design is entirely up to you.

Store Your Data

Instead of hardcoding repeated information into HTML, store it in JavaScript.

For example:

  • Projects
  • Hobbies
  • Skills
  • Social Media Links
  • Contact Information

should come from arrays or objects.

Render with JavaScript

Use loops to create the HTML dynamically.

Use DOM manipulation such as:

  • getElementById()
  • querySelector()
  • createElement()
  • appendChild()
  • innerHTML

instead of manually writing repeated HTML.

Example

Instead of writing:

<div>Project 1</div>
<div>Project 2</div>
<div>Project 3</div>

Store the data:

const projects = [
    { name: "Project 1" },
    { name: "Project 2" },
    { name: "Project 3" }
];

Then generate the HTML:

const projectsContainer = document.getElementById("projects-container");

projects.forEach(project => {
    const projectCard = document.createElement("div");

    projectCard.className = "project-card";
    projectCard.textContent = project.name;

    projectsContainer.appendChild(projectCard);
});

Your HTML only needs a container:

<section>
    <h2>Projects</h2>
    <div id="projects-container"></div>
</section>
If you find yourself copying and pasting similar HTML multiple times, ask yourself:"Can I store this as data and generate it with JavaScript?"The answer is almost always yes.

Requirements Checklist

Before submitting, make sure your project includes:

  • Navigation Bar
  • Hero Section
  • About Me Section
  • Projects or Hobbies Section
  • Contact Me Section
  • Footer
  • At least one array of objects
  • At least one loop (for or forEach)
  • DOM manipulation
  • At least one reusable function
  • No repeated hardcoded project or hobby HTML

Expected Output

Your finished portfolio should:

  • Display your personal information.
  • Show projects or hobbies generated from JavaScript data.
  • Look organized and readable.
  • Demonstrate the use of loops instead of duplicated HTML.

The appearance is flexible, but the JavaScript logic is the focus of this activity.

What to Submit

Submit the following:

  1. GitHub Repository Link or Google Drive Link containing your source code.
  2. Screenshot or Google Docs Link showing the AI prompts you used while building the project.
You may use AI tools such as ChatGPT to assist you, but you must understand the code you submit. During checking, you may be asked to explain how your loops, functions, or DOM manipulation work.

Grading Rubric

CategoryPoints
JavaScript Logic25
Proper Use of Arrays & Objects20
Loop Usage15
DOM Manipulation15
Code Organization10
Portfolio Completeness10
Submission Requirements5
Total100
This activity is designed to reinforce one of the most important programming habits:Don't repeat yourself (DRY).When information repeats, store it as data and let JavaScript build the interface for you.

Related notes