| Level Navigation: 1 | 2 | 3 | 4 | Current Level: 5 | 6 | 7 | 8 | 9 | 10 |
Goal: Create a Bootstrap card with span elements to display weather information.
In your index.html, add this Bootstrap card inside the container div:
<div class="card" style="width: 18rem;">
<div class="card-body">
<h5 class="card-title">New Orleans Weather</h5>
<p class="card-text">
Temperature: <span id="temp"></span>ยฐC<br>
Wind Speed: <span id="wind"></span> km/h<br>
Weather Code: <span id="code"></span>
</p>
</div>
</div>
temp, wind, code (weโll connect these in the next step)The Bootstrap card provides a professional, responsive container for displaying weather information. By using span elements with specific IDs, you create placeholders that JavaScript can target and update dynamically. This approach separates the structure (HTML) from the content (JavaScript), following modern web development principles and making your app look polished and professional.
A <span> tag is an inline HTML element used to mark up a part of text. Itโs perfect for targeting specific text with JavaScript because you can give it an id attribute and then use functions like setText() to update just that part of the content without affecting the rest of the paragraph. ๐ Learn more about span tags
temp, wind, codeReady for the next step? Continue to Step 6: Display Weather Data
| Level Navigation: 1 | 2 | 3 | 4 | Current Level: 5 | 6 | 7 | 8 | 9 | 10 |