Inches to Centimeters Converter /* Add some basic styling to the page */ body { font-family: Arial, sans-serif; margin: 0; padding: 0; } h1 { text-align: center; margin: 20px 0; } /* Style the form */ form { max-width: 400px; margin: 0 auto; text-align: center; } label { display: block; margin: 10px 0; } input[type="text"] { width: 100%; padding: 12px 20px; margin: 8px 0; box-sizing: border-box; border: 1px solid #ccc; border-radius: 4px; } input[type="button"] { width: 100%; background-color: #4CAF50; color: white; padding: 14px 20px; margin: 8px 0; border: none; border-radius: 4px; cursor: pointer; } input[type="button"]:hover { background-color: #45a049; } /* Style the result */ #result { font-weight: bold; } Inches to Centimeters Converter Enter inches: Result: function convertInchesToCentimeters() { // Get the value of the inches input field var inches = document.getElementById("inches").value; // Convert inches to centimeters var centimeters = inches * 2.54; // Display the result document.getElementById("result").innerHTML = centimeters + " centimeters"; }