</> ConvertAtlas Developer Tools
Bootstrap 5 · Beginner

Temperature Toggle

A small weather card toggling between Celsius and Fahrenheit.

Requires Bootstrap 5. Add the CDN tags below to your page (styles in <head>, scripts before </body>). The downloaded file already includes them.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<div class="card border-0 shadow-sm" style="max-width:200px"><div class="card-body text-center">
  <h6 class="fw-bold" id="tmTemp">18°C</h6>
  <div class="fs-1" id="tmIcon">🌤️</div>
  <button class="btn btn-outline-primary btn-sm mt-2" id="tmBtn">Switch to °F</button>
</div></div>
var temp=document.getElementById('tmTemp'),btn=document.getElementById('tmBtn'),c=true;
btn.onclick=function(){c=!c;temp.textContent=c?'18°C':'64°F';btn.textContent=c?'Switch to °F':'Switch to °C'};
Free to use.This component uses Bootstrap 5 (linked above). Copy any file, or download a ready-to-open .html page with the CDN links already included.