Hand Circumference (inches):Calculate Glove Size

<script>
    function calculateGloveSize() {
        const handCircumference = parseFloat(document.getElementById('handCircumference').value);

        if (isNaN(handCircumference) || handCircumference <= 0) {
            alert("Please enter a valid hand circumference.");
            return;
        }

        let gloveSize;
        if (handCircumference <= 7) {
            gloveSize = 'Small';
        } else if (handCircumference <= 8.5) {
            gloveSize = 'Medium';
        } else if (handCircumference <= 10) {
            gloveSize = 'Large';
        } else {
            gloveSize = 'X-Large';
        }

        const resultsDiv = document.getElementById('results');
        resultsDiv.innerHTML = `
            <p>Hand Circumference: <strong>${handCircumference.toFixed(2)} inches</strong></p>
            <p>Recommended Glove Size: <strong>${gloveSize}</strong></p>
        `;
    }
</script>