Calculating Volume with Weight

Volume from Weight Calculator: Expert Guide & Tool :root { –primary-color: #004a99; –success-color: #28a745; –background-color: #f8f9fa; –text-color: #333; –border-color: #ccc; –card-background: #fff; –shadow-color: rgba(0, 0, 0, 0.1); } body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: var(–background-color); color: var(–text-color); line-height: 1.6; margin: 0; padding: 0; } .container { max-width: 1000px; margin: 20px auto; padding: 20px; background-color: var(–card-background); border-radius: 8px; box-shadow: 0 4px 15px var(–shadow-color); } h1, h2, h3 { color: var(–primary-color); text-align: center; margin-bottom: 1.5em; } h1 { font-size: 2.5em; } h2 { font-size: 1.8em; margin-top: 1.5em; border-bottom: 2px solid var(–primary-color); padding-bottom: 0.5em; } h3 { font-size: 1.3em; margin-top: 1.2em; } .calculator-section { background-color: #fff; padding: 30px; border-radius: 8px; box-shadow: inset 0 2px 5px var(–shadow-color); margin-bottom: 30px; } .calculator-section h2 { text-align: left; margin-bottom: 1em; } .loan-calc-container { display: flex; flex-direction: column; gap: 20px; } .input-group { display: flex; flex-direction: column; gap: 8px; } .input-group label { font-weight: bold; font-size: 1.1em; color: var(–primary-color); } .input-group input[type="number"], .input-group input[type="text"], .input-group select { padding: 12px 15px; border: 1px solid var(–border-color); border-radius: 5px; font-size: 1em; width: 100%; box-sizing: border-box; } .input-group input[type="number"]:focus, .input-group input[type="text"]:focus, .input-group select:focus { outline: none; border-color: var(–primary-color); box-shadow: 0 0 0 3px rgba(0, 74, 153, 0.2); } .input-group .helper-text { font-size: 0.85em; color: #666; margin-top: 5px; } .input-group .error-message { color: #dc3545; font-size: 0.9em; margin-top: 5px; display: none; /* Hidden by default */ } .button-group { display: flex; gap: 15px; margin-top: 25px; flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */ } button { padding: 12px 25px; border: none; border-radius: 5px; cursor: pointer; font-size: 1.05em; font-weight: bold; transition: background-color 0.3s ease, transform 0.2s ease; white-space: nowrap; /* Prevent button text wrapping */ } button.primary { background-color: var(–primary-color); color: white; } button.primary:hover { background-color: #003366; transform: translateY(-2px); } button.secondary { background-color: #6c757d; color: white; } button.secondary:hover { background-color: #5a6268; transform: translateY(-2px); } button.copy { background-color: var(–success-color); color: white; } button.copy:hover { background-color: #218838; transform: translateY(-2px); } .results-section { margin-top: 30px; padding: 25px; background-color: #e9ecef; border-radius: 8px; border-left: 5px solid var(–primary-color); } .results-section h3 { margin-top: 0; margin-bottom: 15px; color: var(–primary-color); text-align: left; } .primary-result { font-size: 2.2em; font-weight: bold; color: var(–primary-color); background-color: #fff; padding: 15px 20px; border-radius: 5px; margin-bottom: 20px; text-align: center; box-shadow: 0 2px 5px var(–shadow-color); } .intermediate-results div, .formula-explanation { margin-bottom: 15px; font-size: 1.1em; } .intermediate-results strong, .formula-explanation strong { color: var(–primary-color); display: inline-block; min-width: 150px; } .chart-container { margin-top: 30px; padding: 20px; background-color: var(–card-background); border-radius: 8px; box-shadow: 0 2px 5px var(–shadow-color); text-align: center; } canvas { max-width: 100%; height: auto; } .chart-caption { font-size: 0.9em; color: #666; margin-top: 10px; } table { width: 100%; border-collapse: collapse; margin-top: 30px; box-shadow: 0 2px 5px var(–shadow-color); } th, td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #ddd; } thead th { background-color: var(–primary-color); color: white; font-weight: bold; } tbody tr:nth-child(even) { background-color: #f2f2f2; } .article-content { margin-top: 40px; background-color: var(–card-background); padding: 30px; border-radius: 8px; box-shadow: 0 4px 15px var(–shadow-color); } .article-content p, .article-content ul, .article-content ol { margin-bottom: 1.5em; } .article-content li { margin-bottom: 0.7em; } .article-content a { color: var(–primary-color); text-decoration: none; } .article-content a:hover { text-decoration: underline; } .faq-section { margin-top: 30px; padding: 20px; background-color: #e9ecef; border-radius: 8px; } .faq-section h3 { margin-top: 0; color: var(–primary-color); text-align: left; } .faq-item { margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px dashed #ccc; } .faq-item:last-child { border-bottom: none; } .faq-question { font-weight: bold; color: var(–primary-color); cursor: pointer; margin-bottom: 8px; display: block; } .faq-answer { font-size: 0.95em; margin-left: 20px; color: #555; display: none; /* Hidden by default, toggled by JS */ } .related-tools { margin-top: 30px; padding: 20px; background-color: var(–card-background); border-radius: 8px; border-top: 3px solid var(–primary-color); } .related-tools h3 { text-align: left; margin-top: 0; } .related-tools ul { list-style: none; padding: 0; } .related-tools li { margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid #eee; } .related-tools li:last-child { border-bottom: none; } /* Responsive Adjustments */ @media (min-width: 768px) { .container { margin: 30px auto; padding: 30px; } .button-group { justify-content: flex-start; /* Align buttons to the left */ } }

Volume from Weight Calculator: Expert Tool

Calculate Volume from Weight

Enter the total weight of the material.
Enter the material's density (e.g., kg/m³, g/cm³).
Kilograms per Cubic Meter (kg/m³) Grams per Cubic Centimeter (g/cm³) Pounds per Cubic Foot (lb/ft³) Ounces per Cubic Inch (oz/in³)
Select the units used for density.
Kilograms (kg) Grams (g) Pounds (lb) Ounces (oz)
Select the units used for weight.

Calculation Results

Volume:
Density:
Weight:
Formula Used: Volume = Weight / Density

Volume vs. Density Relationship

This chart illustrates how volume changes with different densities for a constant weight (e.g., 1000 kg).

{primary_keyword}

{primary_keyword} is a fundamental calculation in physics and engineering that determines the amount of space a substance occupies (its volume) given its mass (weight) and how tightly packed its constituent particles are (density). Essentially, it answers the question: "If I have X amount of this material by weight, how much space will it take up?" This calculation is crucial in various industries, from logistics and manufacturing to material science and even culinary arts.

Understanding {primary_keyword} is essential for anyone dealing with bulk materials, packaging, shipping, or precise material usage. Whether you're a logistics manager calculating pallet space, a chemical engineer determining reactor volume, or a baker scaling a recipe, this conversion is indispensable.

Who should use it?

  • Logistics and supply chain professionals
  • Manufacturers and production planners
  • Material scientists and researchers
  • Construction and civil engineers
  • Warehouse managers
  • Anyone working with bulk commodities (grains, powders, liquids, metals)

Common Misconceptions:

  • Confusing density with specific gravity: While related, specific gravity is a ratio to water's density, whereas density has absolute units.
  • Assuming density is constant: For many materials, density can vary with temperature, pressure, and even the material's composition or packing method (especially for powders and granular substances).
  • Ignoring unit consistency: A common pitfall is using inconsistent units (e.g., weight in kilograms and density in grams per cubic centimeter) leading to wildly incorrect volume calculations.

{primary_keyword} Formula and Mathematical Explanation

The core relationship between weight (mass), density, and volume is defined by the density formula. Density is typically expressed as mass per unit volume.

The fundamental formula is:

Density = Weight / Volume

To calculate volume from weight, we simply rearrange this formula to solve for Volume:

Volume = Weight / Density

This formula assumes that the density of the material is uniform throughout the mass being measured.

Step-by-step derivation:

  1. Start with the definition of density: \( \rho = \frac{m}{V} \), where \( \rho \) is density, \( m \) is mass (or weight), and \( V \) is volume.
  2. We are given the weight (m) and the density ( \( \rho \) ).
  3. To find the volume (V), multiply both sides of the equation by V: \( \rho \times V = m \).
  4. Then, divide both sides by density ( \( \rho \) ): \( V = \frac{m}{\rho} \).
  5. Thus, Volume = Weight / Density.

Variable Explanations:

  • Weight (m): This is the mass of the substance. In practical terms, it's what you measure on a scale.
  • Density ( \( \rho \) ): This is a measure of how much mass is contained within a given volume. It tells you how "compact" a substance is.
  • Volume (V): This is the amount of three-dimensional space the substance occupies.

Variables Table:

Variable Meaning Unit (Examples) Typical Range
Weight (m) Mass of the material kg, g, lb, oz Varies widely based on application
Density ( \( \rho \) ) Mass per unit volume kg/m³, g/cm³, lb/ft³, oz/in³ 0.001225 kg/m³ (Air at sea level) to >20,000 kg/m³ (Osmium)
Volume (V) Space occupied m³, cm³, ft³, in³, L, mL Varies widely based on application

Practical Examples ({primary_keyword})

Here are a couple of scenarios demonstrating how {primary_keyword} is applied:

Example 1: Calculating Storage Space for Cement Bags

A construction company receives a shipment of 10,000 kg of Portland cement. The density of bulk Portland cement is approximately 3150 kg/m³ (or 3.15 g/cm³). They need to know the total volume this cement will occupy in their warehouse.

Inputs:

  • Weight = 10,000 kg
  • Density = 3150 kg/m³

Calculation:

Volume = Weight / Density = 10,000 kg / 3150 kg/m³

Volume ≈ 3.17 m³

Interpretation: The 10,000 kg of cement will occupy approximately 3.17 cubic meters of space. This helps the company determine how much storage area is needed and if it fits within designated storage containers or warehouse sections.

Example 2: Determining Volume of a Chemical Solution

A laboratory has 500 grams of a specific chemical solution. The density of this solution at room temperature is measured to be 1.15 g/cm³. The lab needs to know the volume for an experiment requiring precise liquid measurements.

Inputs:

  • Weight = 500 g
  • Density = 1.15 g/cm³

Calculation:

Volume = Weight / Density = 500 g / 1.15 g/cm³

Volume ≈ 434.78 cm³

Interpretation: The 500 grams of chemical solution will occupy approximately 434.78 cubic centimeters. This volume can be easily converted to milliliters (since 1 cm³ = 1 mL), meaning the lab has about 434.78 mL of the solution.

How to Use This {primary_keyword} Calculator

Our {primary_keyword} calculator is designed for simplicity and accuracy. Follow these steps to get your results:

  1. Enter Material Weight: Input the total weight of the material you are measuring into the "Weight of Material" field.
  2. Enter Material Density: Input the known density of the material into the "Density of Material" field.
  3. Select Weight Units: Choose the unit of measurement for the weight you entered (e.g., kg, lb).
  4. Select Density Units: Choose the unit of measurement for the density you entered (e.g., kg/m³, g/cm³). Ensure your weight and density units are compatible. For example, if density is in kg/m³, weight should ideally be in kg. The calculator handles common conversions implicitly via the density unit.
  5. Click Calculate: Press the "Calculate Volume" button.

Reading the Results:

  • The Primary Result displays the calculated volume in a standard unit (often cubic meters or cubic feet, depending on the input density unit).
  • Intermediate Results show the input values for weight and density, and the calculated volume, allowing for easy verification.
  • The Formula Used section clarifies the simple division employed.

Decision-Making Guidance: Use the calculated volume to plan storage, determine shipping requirements, estimate material needs for projects, or ensure accurate batching in production processes. Compare the results against available space or required quantities.

Key Factors That Affect {primary_keyword} Results

While the formula \( V = m / \rho \) is straightforward, several real-world factors can influence the accuracy and applicability of the results:

  1. Temperature Variations: The density of most substances changes with temperature. Liquids and gases are particularly sensitive. A density value measured at one temperature might not be accurate at another, affecting the calculated volume. For precise applications, ensure density values correspond to the operating temperature.
  2. Pressure Variations: Primarily affects gases, where pressure significantly alters density. While less impactful on liquids and solids, extreme pressure can cause slight changes.
  3. Material Purity and Composition: Slight variations in the composition of a material (e.g., alloys, mixtures, impurities) can alter its density. For critical calculations, use the specific density of the exact grade or mixture being used.
  4. Moisture Content: For granular materials like grains, sand, or powders, absorbed moisture can significantly increase the weight without proportionally increasing the volume, effectively lowering the bulk density. Conversely, some materials might expand or contract when absorbing/releasing moisture.
  5. Particle Size and Packing (for Granular Materials): The way granular materials or powders are packed influences their bulk density. Fine powders might settle into a denser state than larger, irregularly shaped granules. This variability requires using an appropriate "bulk density" value that reflects the actual packing.
  6. Compaction and Settling: Over time or under stress, materials (especially powders, soils, or liquids) can compact, increasing their density and decreasing their volume for a given weight. This is critical in storage and transportation planning.
  7. Measurement Accuracy: The precision of both the weight measurement and the density determination directly impacts the accuracy of the calculated volume. Use calibrated instruments for reliable results.
  8. Phase Changes: If temperature or pressure changes cause a substance to change its state (e.g., solid to liquid, liquid to gas), its density changes dramatically, leading to vastly different volumes for the same weight.

Frequently Asked Questions (FAQ)

What's the difference between weight and mass in this calculation?
In everyday language and many practical applications like this calculator, "weight" is often used interchangeably with "mass". Technically, mass is a measure of inertia, while weight is the force of gravity on that mass. Density is fundamentally mass per unit volume. For calculations on Earth, using a "weight" measured by a scale directly in place of "mass" works because gravity is constant.
Can I use this calculator for liquids and gases?
Yes, absolutely. As long as you have the correct density for the specific liquid or gas at the relevant temperature and pressure, the formula Volume = Weight / Density applies. Densities for liquids and gases are often more sensitive to temperature and pressure changes than solids.
How important is unit consistency?
Extremely important. If your weight is in kilograms (kg) and your density is in grams per cubic centimeter (g/cm³), you must convert units before calculating. Our calculator helps by allowing you to select units, but always double-check that your initial inputs and selected units align correctly. Mismatched units are a primary source of errors.
What is "bulk density" vs. "true density"?
True density refers to the density of the solid material itself, excluding any air spaces within. Bulk density refers to the density of a material including the interstitial spaces between particles (e.g., powders, grains). For calculating the space occupied by a pile or container of such materials, bulk density is the appropriate value to use.
How does temperature affect density and volume calculations?
Most substances expand when heated and contract when cooled. This means density generally decreases as temperature increases (and vice versa). For precise calculations, always use the density value that corresponds to the temperature of the material you are measuring.
My material is a mixture. How do I find its density?
For simple mixtures where components don't react chemically, you can sometimes estimate the mixture's density based on the proportions and densities of its components. However, for accuracy, it's best to measure the density of the specific mixture directly using appropriate laboratory techniques.
What is the typical density range for common materials?
Density varies enormously. Air is very light (approx. 1.2 kg/m³), water is 1000 kg/m³, aluminum is about 2700 kg/m³, iron is around 7870 kg/m³, and heavy metals like gold or lead are much denser. Powders and granular materials typically fall in the range of a few hundred to a couple of thousand kg/m³ (bulk density).
Can I use this calculator for shipping volume calculations?
Yes, if you know the weight of the goods and their material density, you can calculate the volume. This is useful for estimating cargo space requirements. However, for shipping, dimensional weight (volumetric weight) is also often considered, which relates volume directly to a notional weight for pricing purposes.

© 2023 Expert Financial Calculators. All rights reserved.

var weightInput = document.getElementById('weight'); var densityInput = document.getElementById('density'); var weightUnitSelect = document.getElementById('weightUnit'); var densityUnitSelect = document.getElementById('densityUnit'); var primaryResultDiv = document.getElementById('primaryResult'); var intermediateVolumeDiv = document.getElementById('intermediateVolume'); var intermediateDensityDiv = document.getElementById('intermediateDensity'); var intermediateWeightDiv = document.getElementById('intermediateWeight'); var weightErrorDiv = document.getElementById('weightError'); var densityErrorDiv = document.getElementById('densityError'); var chart = null; var chartContext = document.getElementById('volumeDensityChart').getContext('2d'); function convertToKgPerM3(value, unit) { var numericValue = parseFloat(value); if (isNaN(numericValue)) return NaN; switch (unit) { case 'kg_m3': return numericValue; case 'g_cm3': return numericValue * 1000; // 1 g/cm³ = 1000 kg/m³ case 'lb_ft3': return numericValue * 16.0185; // 1 lb/ft³ ≈ 16.0185 kg/m³ case 'oz_in3': return numericValue * 1729.37; // 1 oz/in³ ≈ 1729.37 kg/m³ default: return NaN; } } function convertWeightToKg(value, unit) { var numericValue = parseFloat(value); if (isNaN(numericValue)) return NaN; switch (unit) { case 'kg': return numericValue; case 'g': return numericValue / 1000; case 'lb': return numericValue * 0.453592; case 'oz': return numericValue * 0.0283495; default: return NaN; } } function getVolumeUnitSymbol(densityUnit) { switch (densityUnit) { case 'kg_m3': return 'm³'; case 'g_cm3': return 'cm³'; case 'lb_ft3': return 'ft³'; case 'oz_in3': return 'in³'; default: return "; } } function validateInput(value, errorElement, min, max) { var numValue = parseFloat(value); errorElement.style.display = 'none'; // Hide previous error if (value.trim() === ") { errorElement.innerText = 'This field cannot be empty.'; errorElement.style.display = 'block'; return false; } if (isNaN(numValue)) { errorElement.innerText = 'Please enter a valid number.'; errorElement.style.display = 'block'; return false; } if (numValue < min) { errorElement.innerText = 'Value cannot be negative.'; errorElement.style.display = 'block'; return false; } // No max range validation for weight and density in this context, as they vary greatly. return true; } function calculateVolume() { var weight = weightInput.value; var density = densityInput.value; var weightUnit = weightUnitSelect.value; var densityUnit = densityUnitSelect.value; var isValidWeight = validateInput(weight, weightErrorDiv, 0); var isValidDensity = validateInput(density, densityErrorDiv, 0); if (!isValidWeight || !isValidDensity) { primaryResultDiv.textContent = '–'; intermediateVolumeDiv.innerHTML = 'Volume: –'; intermediateDensityDiv.innerHTML = 'Density: –'; intermediateWeightDiv.innerHTML = 'Weight: –'; updateChart(); // Clear chart if inputs are invalid return; } var numericWeight = parseFloat(weight); var numericDensity = parseFloat(density); var weightInKg = convertWeightToKg(numericWeight, weightUnit); var densityInKgPerM3 = convertToKgPerM3(numericDensity, densityUnit); if (isNaN(weightInKg) || isNaN(densityInKgPerM3) || densityInKgPerM3 === 0) { primaryResultDiv.textContent = 'Error'; intermediateVolumeDiv.innerHTML = 'Volume: Error'; intermediateDensityDiv.innerHTML = 'Density: Error'; intermediateWeightDiv.innerHTML = 'Weight: Error'; updateChart(); return; } var calculatedVolume = weightInKg / densityInKgPerM3; var volumeUnitSymbol = getVolumeUnitSymbol(densityUnit); // Standardize primary result to m³ for consistency if possible, or use original density unit's volume. // For simplicity here, we'll display in the unit derived from density unit. var displayVolume = calculatedVolume; var displayVolumeUnit = volumeUnitSymbol; primaryResultDiv.textContent = displayVolume.toFixed(4) + ' ' + displayVolumeUnit; intermediateVolumeDiv.innerHTML = 'Volume: ' + displayVolume.toFixed(4) + ' ' + displayVolumeUnit; intermediateDensityDiv.innerHTML = 'Density: ' + numericDensity.toFixed(4) + ' ' + densityUnit.replace('_', '/'); // Simple display intermediateWeightDiv.innerHTML = 'Weight: ' + numericWeight.toFixed(4) + ' ' + weightUnit; updateChart(); } function resetCalculator() { weightInput.value = '100'; densityInput.value = '1000'; // Default to water-like density weightUnitSelect.value = 'kg'; densityUnitSelect.value = 'kg_m3'; weightErrorDiv.style.display = 'none'; densityErrorDiv.style.display = 'none'; calculateVolume(); // Recalculate with defaults } function copyResults() { var mainResult = primaryResultDiv.textContent; var intermediateVolume = intermediateVolumeDiv.textContent; var intermediateDensity = intermediateDensityDiv.textContent; var intermediateWeight = intermediateWeightDiv.textContent; var formula = document.querySelector('.formula-explanation strong').textContent + ' ' + document.querySelector('.formula-explanation').textContent.replace('Formula Used: ', "); var textToCopy = "— Volume Calculation Results —\n\n"; textToCopy += mainResult + "\n"; textToCopy += intermediateVolume + "\n"; textToCopy += intermediateDensity + "\n"; textToCopy += intermediateWeight + "\n"; textToCopy += "\n" + formula; navigator.clipboard.writeText(textToCopy).then(function() { // Optionally provide user feedback, e.g., a temporary message var copyButton = document.querySelector('button.copy'); var originalText = copyButton.textContent; copyButton.textContent = 'Copied!'; setTimeout(function() { copyButton.textContent = originalText; }, 2000); }).catch(function(err) { console.error('Failed to copy text: ', err); alert('Failed to copy results. Please copy manually.'); }); } function updateChart() { // Clear previous chart if it exists if (chart) { chart.destroy(); } var weightKg = convertWeightToKg(parseFloat(weightInput.value || '100'), weightUnitSelect.value); // Default to 100kg if empty var densityKgPerM3 = convertToKgPerM3(parseFloat(densityInput.value || '1000'), densityUnitSelect.value); // Default to 1000kg/m³ if empty if (isNaN(weightKg) || isNaN(densityKgPerM3) || densityKgPerM3 === 0) { return; // Don't draw chart if inputs are invalid } var densities = []; var volumes = []; var maxDensityRange = densityKgPerM3 * 3; // Show densities up to 3x the input density var minDensityRange = densityKgPerM3 / 3; // Show densities down to 1/3 of the input density if (minDensityRange 50000) maxDensityRange = 50000; // Cap for practical display var step = (maxDensityRange – minDensityRange) / 10; for (var i = 0; i 0) { densities.push(currentDensity); volumes.push(weightKg / currentDensity); } } // Add the current input density/volume point to the dataset densities.push(densityKgPerM3); volumes.push(weightKg / densityKgPerM3); densities.sort(function(a, b){return a – b}); // Ensure sorted for line chart // Recalculate volumes based on sorted densities volumes = densities.map(function(d) { return weightKg / d; }); var volumeUnit = getVolumeUnitSymbol(densityUnitSelect.value); chart = new Chart(chartContext, { type: 'line', data: { labels: densities.map(function(d) { return d.toFixed(0); }), // Display densities on x-axis datasets: [{ label: 'Calculated Volume (' + volumeUnit + ')', data: volumes, borderColor: 'var(–primary-color)', backgroundColor: 'rgba(0, 74, 153, 0.1)', fill: true, tension: 0.1 }, { label: 'Input Density Point', data: [{ x: densityKgPerM3, y: weightKg / densityKgPerM3 }], borderColor: 'var(–success-color)', backgroundColor: 'var(–success-color)', pointRadius: 7, pointHoverRadius: 10, showLine: false // Only show the point }] }, options: { responsive: true, maintainAspectRatio: false, scales: { x: { title: { display: true, text: 'Density (kg/m³)' } }, y: { title: { display: true, text: 'Volume (' + volumeUnit + ')' } } }, plugins: { legend: { display: true, position: 'top', }, tooltip: { callbacks: { label: function(context) { var label = context.dataset.label || "; if (label) { label += ': '; } if (context.parsed.x !== null) { label += context.parsed.x.toFixed(2) + ' kg/m³'; } if (context.parsed.y !== null) { label += ' / ' + context.parsed.y.toFixed(4) + ' ' + volumeUnit; } return label; } } } } } }); } // Initial calculation and chart draw on page load document.addEventListener('DOMContentLoaded', function() { resetCalculator(); // Set default values and calculate updateChart(); // Draw initial chart // Add event listeners for real-time updates (optional, but good for user experience) weightInput.addEventListener('input', calculateVolume); densityInput.addEventListener('input', calculateVolume); weightUnitSelect.addEventListener('change', calculateVolume); densityUnitSelect.addEventListener('change', calculateVolume); // FAQ toggle functionality var faqQuestions = document.querySelectorAll('.faq-question'); faqQuestions.forEach(function(question) { question.addEventListener('click', function() { var answer = this.nextElementSibling; if (answer.style.display === 'block') { answer.style.display = 'none'; } else { answer.style.display = 'block'; } }); }); });

Leave a Comment