How to Calculate Healthy Weight Range

How to Calculate Healthy Weight Range body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: #f8f9fa; color: #333; line-height: 1.6; margin: 0; padding: 0; } .container { max-width: 1000px; margin: 20px auto; padding: 20px; background-color: #ffffff; border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); } header { background-color: #004a99; color: white; padding: 20px; text-align: center; border-radius: 8px 8px 0 0; } header h1 { margin: 0; font-size: 2.2em; } h2, h3 { color: #004a99; margin-top: 20px; border-bottom: 2px solid #e0e0e0; padding-bottom: 5px; } .calculator-section { margin-top: 30px; padding: 25px; background-color: #eef5fa; border-radius: 8px; border: 1px solid #d0ddee; } .input-group { margin-bottom: 20px; text-align: left; } .input-group label { display: block; margin-bottom: 8px; font-weight: bold; color: #004a99; } .input-group input[type="number"], .input-group select { width: calc(100% – 20px); padding: 12px 10px; border: 1px solid #ccc; border-radius: 5px; box-sizing: border-box; font-size: 1em; transition: border-color 0.3s ease; } .input-group input[type="number"]:focus, .input-group select:focus { border-color: #004a99; outline: none; box-shadow: 0 0 0 2px rgba(0, 74, 153, 0.2); } .input-group .helper-text { font-size: 0.85em; color: #666; margin-top: 5px; display: block; } .error-message { color: #dc3545; font-size: 0.9em; margin-top: 5px; display: none; /* Hidden by default */ font-weight: bold; } .button-group { margin-top: 25px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; } .button-group button { padding: 12px 20px; border: none; border-radius: 5px; font-size: 1em; font-weight: bold; cursor: pointer; transition: background-color 0.3s ease, transform 0.2s ease; flex: 1; /* Make buttons take up equal space */ min-width: 150px; /* Prevent buttons from becoming too small */ } .btn-calculate { background-color: #004a99; color: white; } .btn-calculate:hover { background-color: #003a7a; transform: translateY(-2px); } .btn-reset { background-color: #6c757d; color: white; } .btn-reset:hover { background-color: #5a6268; transform: translateY(-2px); } .btn-copy { background-color: #28a745; color: white; } .btn-copy:hover { background-color: #218838; transform: translateY(-2px); } #results { margin-top: 30px; padding: 25px; background-color: #d4edda; border: 1px solid #c3e6cb; border-radius: 8px; text-align: center; display: none; /* Hidden by default */ } #results h3 { margin-top: 0; color: #155724; border-bottom: 1px solid #155724; } .main-result { font-size: 2.5em; font-weight: bold; color: #28a745; margin: 15px 0; } .intermediate-results div { margin: 10px 0; font-size: 1.1em; } .intermediate-results span { font-weight: bold; color: #004a99; } .formula-explanation { font-size: 0.95em; color: #555; margin-top: 15px; text-align: left; } .chart-container { margin-top: 30px; text-align: center; padding: 20px; background-color: #f0f0f0; border-radius: 8px; } canvas { max-width: 100%; height: auto; } .chart-caption { font-size: 0.9em; color: #666; margin-top: 10px; display: block; } table { width: 100%; border-collapse: collapse; margin-top: 25px; } th, td { padding: 12px; text-align: left; border-bottom: 1px solid #ddd; } thead { background-color: #004a99; color: white; } tbody tr:nth-child(even) { background-color: #f2f2f2; } .article-content { margin-top: 40px; text-align: left; } .article-content p, .article-content ul, .article-content ol { margin-bottom: 15px; } .article-content li { margin-bottom: 8px; } .article-content a { color: #004a99; text-decoration: none; font-weight: bold; } .article-content a:hover { text-decoration: underline; } .faq-section { background-color: #fff3cd; border: 1px solid #ffeeba; padding: 20px; border-radius: 8px; margin-top: 25px; } .faq-section h3 { color: #856404; border-bottom-color: #856404; } .faq-item { margin-bottom: 15px; } .faq-item h4 { margin-bottom: 5px; color: #856404; cursor: pointer; } .faq-item p { margin-top: 5px; display: none; /* Hidden by default */ } .related-tools { background-color: #e2f0cb; border: 1px solid #d4edda; padding: 20px; border-radius: 8px; margin-top: 25px; } .related-tools h3 { color: #155724; border-bottom-color: #155724; } .related-tools ul { list-style: none; padding: 0; } .related-tools li { margin-bottom: 10px; } footer { text-align: center; margin-top: 40px; padding: 20px; font-size: 0.9em; color: #666; }

How to Calculate Healthy Weight Range

Your trusted tool for understanding ideal body weight.

Healthy Weight Range Calculator

Enter your height in centimeters.
Male Female Select your biological sex for more accurate ranges.

Your Healthy Weight Range

Ideal Weight (kg):
Lower End (kg):
Upper End (kg):

This calculator uses a commonly accepted formula based on height and biological sex to estimate a healthy weight range. For males, the Hamwi formula is often used as a starting point: 106 lbs for the first 5 feet of height + 6 lbs for each inch over 5 feet. For females: 100 lbs for the first 5 feet + 5 lbs for each inch over 5 feet. These are then converted to kilograms and a range is provided. This is an estimation tool, not a diagnostic one.

Weight Range Visualization

Comparison of your ideal weight vs. the healthy range.

What is Healthy Weight Range Calculation?

Understanding how to calculate healthy weight range is a crucial step towards maintaining a lifestyle that promotes well-being and reduces the risk of various health conditions. A healthy weight range isn't a single magic number, but rather a spectrum of weights that are associated with good health and longevity for a given height and biological sex. Calculating this range provides a personalized target, moving beyond generalized advice to offer more specific guidance. This method helps individuals assess their current weight status and set realistic goals for weight management.

Who should use it? Anyone looking to understand their ideal body weight, whether they are aiming to lose weight, gain weight, or simply maintain a healthy lifestyle, can benefit from calculating their healthy weight range. It's particularly useful for individuals who are concerned about their weight-related health risks, such as those with a family history of obesity-related diseases, or those who have been advised by a healthcare professional to monitor their weight. This calculation serves as a foundational tool for personalized health planning.

Common misconceptions about healthy weight range include believing there's one single ideal weight for everyone of a certain height, or that BMI alone is the definitive measure of health. While BMI is a useful screening tool, it doesn't account for body composition (muscle vs. fat), frame size, or fat distribution, all of which play a role in health. Furthermore, focusing solely on a number without considering overall lifestyle factors like diet, exercise, sleep, and stress is also a common pitfall. The concept of a "healthy weight range" acknowledges that a degree of individual variation is normal and healthy.

Healthy Weight Range Formula and Mathematical Explanation

The calculation of a healthy weight range typically relies on established formulas that take into account an individual's height and biological sex. One of the most widely used methods, simplified for this calculator, is a variation of the Hamwi formula. This formula provides a baseline for ideal weight, and then a range is derived from it.

Step-by-step derivation:

  1. Determine Height: Convert total height into feet and inches. For example, 170 cm is approximately 5 feet 7 inches.
  2. Apply Base Formula (Male): For males, the baseline is 106 lbs for the first 5 feet (60 inches) of height. For every inch over 5 feet, add 6 lbs.
  3. Apply Base Formula (Female): For females, the baseline is 100 lbs for the first 5 feet (60 inches) of height. For every inch over 5 feet, add 5 lbs.
  4. Calculate Total Ideal Weight (lbs): Sum the base weight and the weight added for additional inches.
  5. Convert to Kilograms: Divide the total weight in pounds by 2.20462 to get the ideal weight in kilograms.
  6. Establish Healthy Range: A commonly used range is +/- 10% of the ideal calculated weight. This provides a lower and upper limit considered healthy.

Variable Explanations:

  • Height: The vertical measurement from the sole of the foot to the top of the head.
  • Biological Sex: Determines the base weight and the weight added per inch, reflecting general physiological differences in body composition.
  • Ideal Weight (kg): The calculated single point considered optimal for the given height and sex.
  • Healthy Weight Range (kg): The lower and upper bounds of weight considered healthy, typically +/- 10% of the ideal weight.

Variables Table:

Variable Meaning Unit Typical Range
Height Individual's vertical measurement cm / inches Varies based on individual
Biological Sex Classification based on reproductive organs and genetics Categorical (Male/Female) Male or Female
Ideal Weight Target weight based on height and sex kg / lbs Calculated value
Healthy Weight Range Acceptable weight spectrum for health kg / lbs Calculated +/- 10% of Ideal Weight

Practical Examples (Real-World Use Cases)

Example 1: Sarah, aiming for a healthy weight

Sarah is 165 cm tall and identifies as female. She wants to know her healthy weight range.

  • Inputs: Height: 165 cm, Biological Sex: Female
  • Calculation Process (Simplified):
    • 165 cm is approximately 5 feet 5 inches.
    • Female base: 100 lbs for first 5 feet.
    • Additional inches: 5 inches over 5 feet.
    • Weight added: 5 inches * 5 lbs/inch = 25 lbs.
    • Total ideal weight (lbs): 100 lbs + 25 lbs = 125 lbs.
    • Ideal weight (kg): 125 lbs / 2.20462 ≈ 56.7 kg.
    • Lower end (10% less): 56.7 kg * 0.90 ≈ 51.0 kg.
    • Upper end (10% more): 56.7 kg * 1.10 ≈ 62.4 kg.
  • Outputs: Ideal Weight: 56.7 kg, Healthy Range: 51.0 kg – 62.4 kg.
  • Interpretation: Sarah's healthy weight range is approximately 51.0 kg to 62.4 kg. If her current weight falls within this range, she is considered to be at a healthy weight for her height. If not, she can use this range as a goal for weight management, consulting with a healthcare provider for personalized advice.

Example 2: Michael, assessing his current status

Michael is 180 cm tall and identifies as male. He weighs 85 kg and wants to see if he is within a healthy weight range.

  • Inputs: Height: 180 cm, Biological Sex: Male
  • Calculation Process (Simplified):
    • 180 cm is approximately 5 feet 11 inches.
    • Male base: 106 lbs for first 5 feet.
    • Additional inches: 11 inches over 5 feet.
    • Weight added: 11 inches * 6 lbs/inch = 66 lbs.
    • Total ideal weight (lbs): 106 lbs + 66 lbs = 172 lbs.
    • Ideal weight (kg): 172 lbs / 2.20462 ≈ 78.0 kg.
    • Lower end (10% less): 78.0 kg * 0.90 ≈ 70.2 kg.
    • Upper end (10% more): 78.0 kg * 1.10 ≈ 85.8 kg.
  • Outputs: Ideal Weight: 78.0 kg, Healthy Range: 70.2 kg – 85.8 kg.
  • Interpretation: Michael's healthy weight range is approximately 70.2 kg to 85.8 kg. His current weight of 85 kg falls just within the upper limit of this range. While he is not overweight according to this specific calculation, he is at the higher end, and maintaining a healthy lifestyle through diet and exercise would be beneficial to stay within the optimal range and promote long-term health.

How to Use This Healthy Weight Range Calculator

Using our free online calculator to determine your healthy weight range is straightforward and takes just a few moments. Follow these simple steps to get your personalized results:

  1. Enter Your Height: In the 'Height (in cm)' field, accurately input your height in centimeters. If you know your height in feet and inches, you can convert it to centimeters (e.g., 5'10" is approximately 178 cm).
  2. Select Your Biological Sex: Choose 'Male' or 'Female' from the dropdown menu. This selection is important as the formulas used adjust slightly based on typical physiological differences.
  3. Click 'Calculate Range': Once you've entered your details, click the 'Calculate Range' button. The calculator will process your input and display your results almost instantly.
  4. Review Your Results: You will see your estimated 'Ideal Weight (kg)', and your 'Lower End (kg)' and 'Upper End (kg)' defining your healthy weight range. The main highlighted result shows your ideal weight.
  5. Understand the Explanation: Read the 'Formula Explanation' to understand how the results were generated. Remember, this is an estimate.
  6. Visualize with the Chart: The dynamic chart provides a visual representation of your ideal weight compared to the calculated healthy range.
  7. Copy or Reset: Use the 'Copy Results' button to save your findings, or 'Reset' to clear the fields and perform a new calculation.

How to read results: The primary result is your ideal weight, a single point estimate. The healthy weight range, defined by the lower and upper limits, is the crucial metric. Falling within this range generally indicates a lower risk of weight-related health issues. If your current weight is below the lower end, you might be considered underweight; if it's above the upper end, you might be considered overweight.

Decision-making guidance: Use these results as a starting point for discussions with your healthcare provider. They can help you interpret your range in the context of your overall health, body composition, and lifestyle. If you are outside the healthy range, focus on gradual, sustainable changes to diet and exercise rather than drastic measures. Remember that muscle mass can affect weight, so a very muscular individual might weigh more but still be healthy.

Key Factors That Affect Healthy Weight Range Results

While the calculation provides a useful estimate, several factors can influence whether your calculated healthy weight range is truly representative of your individual health status. It's important to consider these nuances:

  • Body Composition: Muscle is denser than fat. An individual with a high muscle mass might weigh more than the calculated ideal but still have a low body fat percentage and be very healthy. Conversely, someone with low muscle mass might fall within the ideal weight range but have a high body fat percentage, indicating potential health risks.
  • Frame Size: People naturally have different bone structures and frame sizes (small, medium, large). The formulas used are averages and don't explicitly account for variations in bone density or frame size, which can influence overall weight.
  • Age: Metabolism and body composition tend to change with age. While the formulas are generally applicable, a healthy weight for a young adult might differ slightly in terms of optimal body composition for an older adult.
  • Genetics: Your genetic makeup plays a significant role in your metabolism, body shape, and where your body tends to store fat. Some individuals may naturally carry more weight or have a different body composition than what a standard formula suggests.
  • Medical Conditions: Certain medical conditions (e.g., thyroid disorders, PCOS, edema) can affect body weight independent of diet and exercise. These conditions may require medical management and can influence what is considered a "healthy" weight for that individual.
  • Pregnancy and Postpartum: Weight during and after pregnancy fluctuates significantly and is not directly comparable to non-pregnant weight ranges calculated by standard formulas.
  • Ethnicity: Different ethnic groups may have different body compositions and distributions of body fat even at the same BMI or weight-to-height ratio, which can impact health risks associated with weight.

Frequently Asked Questions (FAQ)

Common Questions about Healthy Weight Range

What is the difference between BMI and healthy weight range?

Body Mass Index (BMI) is a ratio of weight to height squared (kg/m²). It categorizes weight into underweight, normal, overweight, and obese. The healthy weight range calculation, often based on formulas like Hamwi, provides a specific target weight or a spectrum of weights considered healthy for a given height and sex. While related, the healthy weight range offers a more personalized target than broad BMI categories.

Is BMI or healthy weight range more accurate?

Neither is perfectly accurate for everyone. BMI is a screening tool that doesn't distinguish between fat and muscle. The healthy weight range calculation provides a more personalized target but also relies on averages and doesn't fully account for individual variations like muscle mass or frame size. Both should be used as starting points for discussion with a healthcare professional.

Can I use this calculator if I am pregnant?

No, this calculator is not suitable for use during pregnancy. Weight gain during pregnancy is highly variable and depends on multiple factors. Consult your healthcare provider for guidance on appropriate weight gain during pregnancy.

What if my weight is just outside the calculated range?

If your weight is slightly above or below the calculated range, it doesn't automatically mean you are unhealthy. Consider factors like muscle mass, activity level, and overall health. However, if you are significantly outside the range or have concerns, it's best to consult a doctor or registered dietitian.

How often should I recalculate my healthy weight range?

Your healthy weight range is primarily determined by your height, which doesn't change significantly after adulthood. Therefore, you typically only need to calculate it once unless your height measurement changes (which is rare). However, your *current* weight will fluctuate, and you might reassess your goals periodically.

Does frame size affect the healthy weight range?

Yes, frame size can affect what is considered a healthy weight. Standard formulas like the one used here don't explicitly measure frame size. Generally, individuals with a larger frame may naturally weigh more than those with a smaller frame at the same height. This is one reason why consulting a healthcare provider is recommended for a comprehensive assessment.

What are the health risks associated with being outside a healthy weight range?

Being significantly underweight or overweight is associated with increased risks of various health problems. These can include cardiovascular disease, type 2 diabetes, certain cancers, sleep apnea, joint problems, and mental health issues. Maintaining a weight within a healthy range is a key component of preventive healthcare.

Can I use this calculator for children?

No, this calculator is designed for adults. Children's and adolescents' growth patterns are dynamic, and their healthy weight is assessed using growth charts that compare their weight and height to other children of the same age and sex. Please consult a pediatrician for assessing a child's healthy weight.

Related Tools and Internal Resources

© 2023 Your Health Resource. All rights reserved.

Disclaimer: This calculator is for informational purposes only and does not constitute medical advice. Always consult with a qualified healthcare professional for any health concerns or before making any decisions related to your health or treatment.

var heightCmInput = document.getElementById('heightCm'); var genderSelect = document.getElementById('gender'); var resultsDiv = document.getElementById('results'); var idealWeightKgSpan = document.getElementById('idealWeightKg'); var lowerEndKgSpan = document.getElementById('lowerEndKg'); var upperEndKgSpan = document.getElementById('upperEndKg'); var mainResultDiv = document.querySelector('#results .main-result'); var heightCmError = document.getElementById('heightCmError'); var genderError = document.getElementById('genderError'); var weightRangeChart; // Declare chart variable function convertHeightToCm(feet, inches) { return (feet * 12 + inches) * 2.54; } function convertCmToFeetInches(cm) { var totalInches = cm / 2.54; var feet = Math.floor(totalInches / 12); var inches = Math.round(totalInches % 12); return { feet: feet, inches: inches }; } function validateInputs() { var isValid = true; var heightCm = parseFloat(heightCmInput.value); // Reset errors heightCmError.style.display = 'none'; genderError.style.display = 'none'; if (isNaN(heightCm) || heightCm <= 0) { heightCmError.textContent = 'Please enter a valid height in centimeters (must be greater than 0).'; heightCmError.style.display = 'block'; isValid = false; } else if (heightCm 250) { // Reasonable range for human height heightCmError.textContent = 'Height seems too short or too tall. Please enter a realistic height.'; heightCmError.style.display = 'block'; isValid = false; } // Gender selection is required but usually doesn't have value errors unless it's empty, which select doesn't allow if options exist. // We'll assume the select always has a value. return isValid; } function calculateHealthyWeightRange() { if (!validateInputs()) { resultsDiv.style.display = 'none'; return; } var heightCm = parseFloat(heightCmInput.value); var gender = genderSelect.value; // Convert cm to feet and inches for Hamwi formula logic var heightImperial = convertCmToFeetInches(heightCm); var feet = heightImperial.feet; var inches = heightImperial.inches; var totalInches = feet * 12 + inches; var idealWeightLbs; // Hamwi formula if (gender === 'male') { idealWeightLbs = 106; // 106 lbs for the first 5 feet (60 inches) if (totalInches > 60) { idealWeightLbs += (totalInches – 60) * 6; // Add 6 lbs for each inch over 60 } } else { // female idealWeightLbs = 100; // 100 lbs for the first 5 feet (60 inches) if (totalInches > 60) { idealWeightLbs += (totalInches – 60) * 5; // Add 5 lbs for each inch over 60 } } var idealWeightKg = idealWeightLbs / 2.20462; var lowerEndKg = idealWeightKg * 0.90; // +/- 10% range var upperEndKg = idealWeightKg * 1.10; // Display results mainResultDiv.textContent = idealWeightKg.toFixed(1) + ' kg'; idealWeightKgSpan.textContent = idealWeightKg.toFixed(1); lowerEndKgSpan.textContent = lowerEndKg.toFixed(1); upperEndKgSpan.textContent = upperEndKg.toFixed(1); resultsDiv.style.display = 'block'; updateChart(idealWeightKg, lowerEndKg, upperEndKg); } function resetCalculator() { heightCmInput.value = '170'; // Sensible default height genderSelect.value = 'male'; // Sensible default gender // Clear errors heightCmError.textContent = "; heightCmError.style.display = 'none'; genderError.textContent = "; genderError.style.display = 'none'; resultsDiv.style.display = 'none'; if (weightRangeChart) { weightRangeChart.destroy(); // Destroy existing chart if any } } function copyResults() { var heightCm = heightCmInput.value; var gender = genderSelect.value; var idealWeight = idealWeightKgSpan.textContent; var lowerEnd = lowerEndKgSpan.textContent; var upperEnd = upperEndKgSpan.textContent; if (resultsDiv.style.display === 'block') { var resultText = "Healthy Weight Range Calculation:\n\n"; resultText += "Inputs:\n"; resultText += "- Height: " + heightCm + " cm\n"; resultText += "- Biological Sex: " + (gender === 'male' ? 'Male' : 'Female') + "\n\n"; resultText += "Results:\n"; resultText += "- Ideal Weight: " + idealWeight + " kg\n"; resultText += "- Healthy Weight Range: " + lowerEnd + " kg – " + upperEnd + " kg\n\n"; resultText += "Assumptions:\n"; resultText += "- Uses a Hamwi-based formula for estimation.\n"; resultText += "- Range is +/- 10% of the ideal weight.\n"; resultText += "- Does not account for body composition, frame size, or medical conditions.\n"; // Use a temporary textarea to copy text to clipboard var textArea = document.createElement("textarea"); textArea.value = resultText; textArea.style.position = "fixed"; // Avoid scrolling to bottom of page in MS Edge. textArea.style.left = "-9999px"; textArea.style.top = "-9999px"; document.body.appendChild(textArea); textArea.focus(); textArea.select(); try { var successful = document.execCommand('copy'); var msg = successful ? 'Results copied to clipboard!' : 'Failed to copy results.'; console.log(msg); // For debugging, or could show a temporary notification } catch (err) { console.error('Fallback: Oops, unable to copy', err); } document.body.removeChild(textArea); } else { console.log("No results to copy yet."); } } function updateChart(ideal, lower, upper) { var ctx = document.getElementById('weightRangeChart').getContext('2d'); // Destroy previous chart instance if it exists if (weightRangeChart) { weightRangeChart.destroy(); } // Create new chart weightRangeChart = new Chart(ctx, { type: 'bar', // Using bar chart for clear visualization of ranges data: { labels: ['Weight (kg)'], datasets: [{ label: 'Ideal Weight', data: [ideal], backgroundColor: 'rgba(40, 167, 69, 0.7)', // Success color borderColor: 'rgba(40, 167, 69, 1)', borderWidth: 1, order: 1 // Ensure ideal weight is drawn on top }, { label: 'Healthy Range', data: [{ x: 'Weight (kg)', y: upper – lower, // Height of the range bar base: lower // Starting point of the range bar }], backgroundColor: 'rgba(0, 74, 153, 0.2)', // Primary color, semi-transparent borderColor: 'rgba(0, 74, 153, 0.5)', borderWidth: 1, order: 2 }] }, options: { responsive: true, maintainAspectRatio: false, scales: { y: { beginAtZero: false, // Allow y-axis to start at a relevant point title: { display: true, text: 'Weight (kg)' } } }, plugins: { legend: { display: true, position: 'top' }, tooltip: { callbacks: { label: function(context) { var label = context.dataset.label || "; if (label) { label += ': '; } if (context.parsed.y !== null) { if (context.dataset.label === 'Healthy Range') { label += context.raw.base.toFixed(1) + ' – ' + context.raw.base.toFixed(1) + context.parsed.y.toFixed(1); } else { label += context.parsed.y.toFixed(1); } } return label; } } } } } }); } // Initial setup for chart – placeholder or initial render if default values exist // Ensure Chart.js is loaded if using it via CDN. For pure JS, we might need a pure SVG/Canvas implementation. // For this example, assuming Chart.js is available. If not, a pure canvas/SVG implementation would be needed. // Let's assume a basic canvas approach for demonstration if Chart.js is not an option. // — Pure Canvas Implementation (if Chart.js is NOT available) — // This part replaces the Chart.js updateChart function if you can't use external libraries. // It's more complex to draw bar charts and ranges accurately this way. // For simplicity and demonstration, the Chart.js approach is usually preferred. // If Chart.js is NOT allowed, a significant rewrite of updateChart is needed. // For now, assuming Chart.js is available via CDN or included elsewhere. // If not, the example would need a pure Canvas or SVG drawing function. // Example of how to include Chart.js if it's not embedded: // // Trigger initial calculation on load if defaults are set document.addEventListener('DOMContentLoaded', function() { // Optionally call calculateHealthyWeightRange() here if you want the chart to render with default values on page load. // resetCalculator(); // Initialize with defaults and clear results // calculateHealthyWeightRange(); // Calculate with defaults }); // FAQ Toggle var faqItems = document.querySelectorAll('.faq-item h4'); faqItems.forEach(function(item) { item.addEventListener('click', function() { var content = this.nextElementSibling; if (content.style.display === 'block') { content.style.display = 'none'; } else { content.style.display = 'block'; } }); });

Leave a Comment