Sub topic 7
Wire Up Hotspots and Navigation
Assume you know basic HTML, CSS selectors, and how a user flow is represented as connected screens. This chapter focuses on interaction behavior: making hotspots move a participant through the intended flow and recording what they do.
Model navigation as state changes
A clickable prototype does not need a complete application architecture. It needs a small model of the states a participant can see and the transitions between them.
A screen state is a visible condition, such as “search results loaded” or “trip details open.” A hotspot is an interactive area that triggers a transition. The transition changes the visible state.
Keep the flow small. A single test should usually explore one important path rather than expose every possible feature.
Give every hotspot a clear destination
Store the destination in data instead of writing a separate click handler for every button. In this example, data-goto identifies the state to show. The script uses event delegation, which means one listener handles clicks from all current hotspots.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Trip planner prototype</title>
<style>
[hidden] { display: none; }
.screen { max-width: 32rem; margin: 3rem auto; }
button { display: block; margin: 1rem 0; padding: .7rem 1rem; }
</style>
</head>
<body>
<section id="home" class="screen" aria-labelledby="home-title">
<h1 id="home-title">Plan a weekend trip</h1>
<button data-goto="results">Search</button>
</section>
<section id="results" class="screen" aria-labelledby="results-title" hidden>
<h1 id="results-title">3 trips found</h1>
<button data-goto="detail">Lisbon, 2 nights</button>
<button data-goto="home">Back</button>
</section>
<section id="detail" class="screen" aria-labelledby="detail-title" hidden>
<h1 id="detail-title">Lisbon, 2 nights</h1>
<p>Flights and hotel from 280 euros.</p>
<button data-goto="home">Start over</button>
</section>
<script>
const clickLog = [];
function show(id) {
const destination = document.getElementById(id);
if (!destination) return;
document.querySelectorAll(".screen").forEach(function (screen) {
screen.hidden = screen !== destination;
});
}
document.addEventListener("click", function (event) {
const hotspot = event.target.closest("[data-goto]");
if (!hotspot) return;
const destination = hotspot.dataset.goto;
if (!document.getElementById(destination)) return;
clickLog.push({
from: document.querySelector(".screen:not([hidden])").id,
to: destination,
label: hotspot.textContent.trim(),
at: Date.now()
});
show(destination);
});
show("home");
</script>
</body>
</html>The hidden attribute controls visibility. The log records the source state, destination state, label, and time. This helps you compare the intended path with the participant’s actual path.
Check interaction behavior
Before testing with people, verify every hotspot manually.
| Check | Expected result |
|---|---|
| Search | Results becomes visible |
| Trip title | Detail becomes visible |
| Back | Home becomes visible |
| Start over | Home becomes visible |
| Unknown destination | Nothing changes and no error appears |
Test keyboard access as well as pointer clicks. Real buttons provide focus and keyboard behavior automatically. Avoid making plain text or decorative shapes clickable unless your prototype also supplies an accessible name and keyboard interaction.
Preserve realistic transitions
Use labels and content that match the real product. A button named “Continue” may test a different expectation from one named “See trip details.” Include loading, empty, error, or confirmation states when the riskiest assumption depends on them. Do not add interactions merely because the finished product might eventually need them.
Exercise
A participant repeatedly clicks the trip card, but the prototype only responds when they click a small text button inside it. What should you change first?
Show answer
Make the intended hotspot match the expected interaction area, such as making the whole card clickable, then retest whether the participant understands the destination.