Truck Driver Mileage Pay Calculator

Truck Driver Mileage Pay Calculator – Calculate Your Earnings :root { –primary-color: #004a99; –success-color: #28a745; –background-color: #f8f9fa; –text-color: #333; –border-color: #ccc; –card-background: #fff; –shadow: 0 2px 5px 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: 20px; display: flex; flex-direction: column; align-items: center; } .container { width: 100%; max-width: 960px; background-color: var(–card-background); padding: 30px; border-radius: 8px; box-shadow: var(–shadow); margin-bottom: 30px; } h1, h2, h3 { color: var(–primary-color); text-align: center; margin-bottom: 20px; } h1 { font-size: 2.5em; } h2 { font-size: 1.8em; margin-top: 30px; } h3 { font-size: 1.4em; margin-top: 25px; } .calculator-wrapper { background-color: var(–card-background); padding: 30px; border-radius: 8px; box-shadow: var(–shadow); margin-bottom: 30px; } .input-group { margin-bottom: 20px; text-align: left; } .input-group label { display: block; margin-bottom: 8px; font-weight: bold; color: var(–primary-color); } .input-group input[type="number"], .input-group input[type="text"], .input-group select { width: calc(100% – 22px); padding: 12px; border: 1px solid var(–border-color); border-radius: 4px; font-size: 1em; 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 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.85em; margin-top: 5px; display: none; /* Hidden by default */ } .button-group { display: flex; justify-content: space-between; margin-top: 25px; gap: 10px; } button { padding: 12px 20px; border: none; border-radius: 4px; cursor: pointer; font-size: 1em; font-weight: bold; transition: background-color 0.3s ease; } .btn-primary { background-color: var(–primary-color); color: white; } .btn-primary:hover { background-color: #003366; } .btn-secondary { background-color: #6c757d; color: white; } .btn-secondary:hover { background-color: #5a6268; } .btn-success { background-color: var(–success-color); color: white; } .btn-success:hover { background-color: #218838; } #results { margin-top: 30px; padding: 25px; border: 1px solid var(–border-color); border-radius: 8px; background-color: #e9ecef; text-align: center; } #results h3 { margin-top: 0; color: var(–primary-color); } .main-result { font-size: 2.2em; font-weight: bold; color: var(–success-color); margin: 15px 0; padding: 10px; background-color: rgba(40, 167, 69, 0.1); border-radius: 4px; } .intermediate-results div { margin-bottom: 10px; font-size: 1.1em; } .intermediate-results span { font-weight: bold; color: var(–primary-color); } .key-assumptions { margin-top: 20px; font-size: 0.9em; color: #555; text-align: left; border-top: 1px dashed #ccc; padding-top: 15px; } .key-assumptions strong { color: var(–primary-color); } table { width: 100%; border-collapse: collapse; margin-top: 20px; box-shadow: var(–shadow); } th, td { padding: 12px; text-align: left; border: 1px solid var(–border-color); } thead { background-color: var(–primary-color); color: white; } tbody tr:nth-child(even) { background-color: #f2f2f2; } caption { font-size: 1.1em; font-weight: bold; color: var(–primary-color); margin-bottom: 10px; caption-side: top; text-align: left; } canvas { margin-top: 20px; border: 1px solid var(–border-color); border-radius: 4px; background-color: var(–card-background); } .article-content { width: 100%; max-width: 960px; background-color: var(–card-background); padding: 30px; border-radius: 8px; box-shadow: var(–shadow); margin-top: 30px; text-align: left; } .article-content h2, .article-content h3 { text-align: left; margin-top: 30px; } .article-content p { margin-bottom: 15px; } .article-content ul, .article-content ol { margin-left: 20px; margin-bottom: 15px; } .article-content li { margin-bottom: 8px; } .article-content strong { color: var(–primary-color); } .faq-item { margin-bottom: 15px; border-bottom: 1px dashed var(–border-color); padding-bottom: 10px; } .faq-item:last-child { border-bottom: none; } .faq-item strong { display: block; color: var(–primary-color); margin-bottom: 5px; cursor: pointer; } .faq-item p { margin-bottom: 0; display: none; /* Hidden by default */ } .internal-links { margin-top: 30px; padding: 20px; background-color: #e9ecef; border-radius: 4px; } .internal-links h3 { margin-top: 0; color: var(–primary-color); text-align: left; } .internal-links ul { list-style: none; padding: 0; margin: 0; } .internal-links li { margin-bottom: 10px; } .internal-links a { color: var(–primary-color); text-decoration: none; font-weight: bold; } .internal-links a:hover { text-decoration: underline; } .internal-links span { font-size: 0.9em; color: #555; display: block; margin-top: 3px; } @media (max-width: 768px) { h1 { font-size: 2em; } h2 { font-size: 1.5em; } .container, .calculator-wrapper, .article-content { padding: 20px; } .button-group { flex-direction: column; } button { width: 100%; } }

Truck Driver Mileage Pay Calculator

Estimate your potential earnings as a truck driver paid by the mile. Enter your details below to see your projected income.

Enter the total number of miles you expect to drive in a given period.
Your contracted rate for each mile driven.
Average cost of fuel for each mile driven.
Includes maintenance, tolls, insurance, etc., per mile.

Your Estimated Earnings

Total Revenue: —
Total Expenses: —
Net Profit: —
Key Assumptions:

Calculations are based on the provided inputs. Actual earnings may vary due to fluctuating fuel prices, unexpected maintenance, varying routes, and other operational factors.

Comparison of Revenue, Expenses, and Net Profit
Mileage Pay Breakdown
Metric Value
Total Miles Driven
Pay Per Mile
Fuel Cost Per Mile
Other Expenses Per Mile
Total Revenue
Total Expenses
Net Profit

What is Truck Driver Mileage Pay?

Truck driver mileage pay is a compensation model where drivers are paid a specific rate for each mile they drive. This is one of the most common payment structures in the trucking industry, particularly for long-haul and over-the-road (OTR) drivers. Instead of an hourly wage or a salary, a driver's earnings are directly tied to the distance they cover. This model incentivizes drivers to stay on the road and complete routes efficiently, as more miles driven generally translate to higher gross pay.

Who should use it: This calculator is designed for truck drivers who are paid on a per-mile basis, owner-operators, fleet managers, and individuals considering a career in trucking. It helps in understanding the financial implications of different pay rates, operational costs, and driving volumes. It's also useful for comparing job offers that use mileage-based compensation.

Common misconceptions: A frequent misconception is that higher pay per mile automatically means higher take-home pay. However, this overlooks significant operational costs like fuel, maintenance, tolls, and insurance, which can drastically reduce net earnings. Another misconception is that all miles are paid; drivers are typically paid for *driving* miles, not necessarily for all the time spent at a loading dock, waiting for a load, or during mandatory breaks. This calculator helps clarify the difference between gross revenue and net profit.

Truck Driver Mileage Pay Formula and Mathematical Explanation

The core of the truck driver mileage pay calculation involves determining the gross revenue generated from driving and then subtracting all associated operational costs to arrive at the net profit. The formula can be broken down as follows:

1. Total Revenue Calculation

Total Revenue = Total Miles Driven × Pay Per Mile

2. Total Expenses Calculation

Total Expenses = (Fuel Cost Per Mile + Other Expenses Per Mile) × Total Miles Driven

Where "Other Expenses Per Mile" typically includes:

  • Maintenance and repairs
  • Tolls and permits
  • Insurance premiums (pro-rated per mile)
  • Taxes (pro-rated per mile)
  • Depreciation of the truck and trailer
  • Other operational overhead

3. Net Profit Calculation

Net Profit = Total Revenue – Total Expenses

This can also be expressed as:

Net Profit = (Pay Per Mile – Fuel Cost Per Mile – Other Expenses Per Mile) × Total Miles Driven

The term (Pay Per Mile – Fuel Cost Per Mile – Other Expenses Per Mile) represents the Net Profit Per Mile.

Variable Explanations

Mileage Pay Variables
Variable Meaning Unit Typical Range
Total Miles Driven The total distance covered by the truck driver during a specific period. Miles 1,500 – 12,000+ per week (depending on route and schedule)
Pay Per Mile The rate paid to the driver for each mile driven. $/Mile $0.40 – $0.80+ (varies by company, experience, freight type)
Fuel Cost Per Mile The average cost of fuel consumed per mile. $/Mile $0.15 – $0.35+ (highly dependent on fuel prices and truck MPG)
Other Expenses Per Mile Sum of all other operational costs (maintenance, tolls, insurance, etc.) per mile. $/Mile $0.10 – $0.30+ (varies greatly based on truck age, usage, and insurance costs)
Total Revenue The total gross income generated before deducting expenses. $ Calculated
Total Expenses The sum of all costs incurred to operate the truck and complete the driving. $ Calculated
Net Profit The final income after all expenses have been deducted from revenue. This is the driver's take-home pay before personal taxes. $ Calculated

Practical Examples (Real-World Use Cases)

Example 1: Long-Haul Driver

Sarah is a long-haul truck driver who averages 2,500 miles per week. Her company pays her $0.55 per mile. Her estimated fuel cost is $0.22 per mile, and other operational expenses (maintenance, tolls, etc.) average $0.13 per mile.

  • Inputs:
  • Total Miles Driven: 2,500 miles
  • Pay Per Mile: $0.55
  • Fuel Cost Per Mile: $0.22
  • Other Expenses Per Mile: $0.13
  • Calculations:
  • Total Revenue = 2,500 miles × $0.55/mile = $1,375
  • Total Expenses = ( $0.22/mile + $0.13/mile ) × 2,500 miles = $0.35/mile × 2,500 miles = $875
  • Net Profit = $1,375 – $875 = $500

Interpretation: Sarah's estimated net profit for the week is $500. This means after covering her direct operational costs, this is the amount she earns before personal income taxes and other deductions. Her net profit per mile is $0.55 – $0.22 – $0.13 = $0.20.

Example 2: Regional Driver with Higher Costs

Mike drives regionally and covers about 1,800 miles per week. He earns $0.60 per mile. However, his truck is older, leading to higher maintenance costs, and he frequently drives through areas with high tolls. His fuel cost is $0.28 per mile, and other expenses are $0.18 per mile.

  • Inputs:
  • Total Miles Driven: 1,800 miles
  • Pay Per Mile: $0.60
  • Fuel Cost Per Mile: $0.28
  • Other Expenses Per Mile: $0.18
  • Calculations:
  • Total Revenue = 1,800 miles × $0.60/mile = $1,080
  • Total Expenses = ( $0.28/mile + $0.18/mile ) × 1,800 miles = $0.46/mile × 1,800 miles = $828
  • Net Profit = $1,080 – $828 = $252

Interpretation: Mike's net profit for the week is $252. Despite a higher pay per mile ($0.60 vs $0.55), his significantly higher operating costs ($0.46/mile vs $0.35/mile) result in a much lower net profit per mile ($0.14) and a lower overall weekly net profit compared to Sarah. This highlights the critical importance of managing expenses.

How to Use This Truck Driver Mileage Pay Calculator

Using the truck driver mileage pay calculator is straightforward. Follow these steps to get an accurate estimate of your earnings:

  1. Enter Total Miles Driven: Input the total number of miles you anticipate driving over a specific period (e.g., a week, a month). Be realistic based on your typical routes and schedule.
  2. Enter Pay Per Mile: Input your contracted rate per mile. This is the base amount your company pays you for each mile you drive.
  3. Enter Fuel Cost Per Mile: Estimate your average fuel expense for every mile driven. This can fluctuate with fuel prices.
  4. Enter Other Expenses Per Mile: Add up all other recurring costs associated with driving (maintenance, tolls, insurance, etc.) and divide by your typical mileage to get a per-mile figure.
  5. Click "Calculate Earnings": Once all fields are populated, click this button. The calculator will instantly display your estimated gross revenue, total expenses, and net profit.

How to read results:

  • Gross Earnings (Main Result): This is your total income before any expenses are deducted.
  • Total Revenue: Same as Gross Earnings in this context.
  • Total Expenses: The sum of your fuel costs and other operational costs based on the miles driven.
  • Net Profit: This is your take-home pay for the period, after direct operational costs are accounted for. This is the figure you'll use for budgeting and personal finance planning before considering personal income taxes.

Decision-making guidance: Use the results to evaluate job offers, negotiate rates, or identify areas where you can reduce costs. If your net profit per mile is too low, you may need to seek higher-paying loads, negotiate better rates, or find ways to decrease your operational expenses. The chart and table provide a visual and structured breakdown to help you understand the components of your earnings.

Key Factors That Affect Truck Driver Mileage Pay Results

Several factors significantly influence the accuracy and outcome of your truck driver mileage pay calculator results. Understanding these can help you manage expectations and optimize your earnings:

  1. Fuel Prices: Fluctuations in diesel prices are a primary driver of cost variability. Higher fuel prices directly increase your "Fuel Cost Per Mile," reducing your net profit unless your "Pay Per Mile" is adjusted accordingly.
  2. Truck Efficiency (MPG): The miles per gallon (MPG) your truck achieves directly impacts fuel costs. A more fuel-efficient truck will have a lower "Fuel Cost Per Mile," boosting net earnings.
  3. Maintenance and Repair Costs: Unexpected breakdowns or regular wear and tear can lead to substantial repair bills. The age, condition, and type of truck, as well as driving habits, influence these costs.
  4. Tolls and Fees: Certain routes, especially in specific regions or through major cities, involve significant toll charges. These add directly to "Other Expenses Per Mile."
  5. Insurance Premiums: Commercial truck insurance is a major expense. Rates vary based on driving record, truck type, cargo, and coverage levels, impacting "Other Expenses Per Mile."
  6. Taxes and Regulations: Various federal, state, and local taxes, as well as compliance costs (e.g., ELD mandates, permits), contribute to operational expenses.
  7. Loading/Unloading Time: While mileage pay primarily compensates for driving, excessive time spent waiting or loading/unloading can reduce the effective hourly rate and overall efficiency, even if not directly impacting the mileage calculation.
  8. Type of Freight: Different types of freight (e.g., dry van, reefer, flatbed, specialized) can have different pay scales and associated costs or risks.
  9. Economic Conditions: Demand for goods and services impacts freight volume and rates. Economic downturns can lead to fewer miles available and lower pay per mile.

Frequently Asked Questions (FAQ)

Q1: Is mileage pay the only way truck drivers get paid?

A: No, while mileage pay is very common, especially for OTR drivers, other pay structures exist. Some drivers are paid hourly, receive a salary, or work on a percentage of the load value. Many owner-operators combine mileage rates with other charges.

Q2: What does "paid miles" mean?

A: "Paid miles" typically refers to the miles driven while actively hauling a load from point A to point B. It usually excludes miles driven deadhead (without a load), miles driven to pick up a load, or miles driven during breaks or downtime. Always clarify this with your dispatcher or company.

Q3: How can I increase my net profit if my pay per mile is low?

A: Focus on reducing your expenses. Improve your truck's fuel efficiency, plan routes to minimize tolls, negotiate better rates for maintenance and insurance, and be mindful of driving habits that increase wear and tear. Also, try to maximize paid miles and minimize deadhead miles.

Q4: Does the calculator account for taxes?

A: The calculator estimates net profit *before* personal income taxes. As an independent contractor or employee, you are responsible for calculating and paying your own income taxes based on your net earnings.

Q5: What is a good pay per mile rate?

A: A "good" rate is subjective and depends heavily on your operating costs and location. However, rates generally range from $0.40 to $0.80+ per mile. For owner-operators, a common benchmark is to aim for a net profit per mile of at least $0.20 – $0.50 after all expenses.

Q6: How do I calculate my "Other Expenses Per Mile"?

A: Track all your non-fuel expenses (maintenance, repairs, tires, tolls, permits, insurance, registration, depreciation, etc.) over a period (e.g., a month or quarter). Sum these costs and divide by the total miles driven during that same period. For example, if you spent $1,000 on maintenance and tolls over 5,000 miles, your other expenses per mile are $1000 / 5000 = $0.20.

Q7: Can I use this calculator for owner-operator income?

A: Yes, this calculator is highly relevant for owner-operators. You would input your contracted rate as your "Pay Per Mile" and then meticulously track your fuel and all other operating expenses to input into the respective fields for an accurate net profit calculation.

Q8: What if my miles driven vary significantly week to week?

A: For variable mileage, it's best to use an average weekly or monthly mileage figure for the calculator. You can also run calculations for different mileage scenarios (e.g., a low-mileage week vs. a high-mileage week) to understand the potential range of your earnings.

var ctx = document.getElementById('earningsChart').getContext('2d'); var earningsChart; function initializeChart() { earningsChart = new Chart(ctx, { type: 'bar', data: { labels: ['Revenue', 'Expenses', 'Net Profit'], datasets: [{ label: 'Amount ($)', data: [0, 0, 0], backgroundColor: [ 'rgba(0, 74, 153, 0.6)', // Primary color for Revenue 'rgba(220, 53, 69, 0.6)', // Danger color for Expenses 'rgba(40, 167, 69, 0.6)' // Success color for Net Profit ], borderColor: [ 'rgba(0, 74, 153, 1)', 'rgba(220, 53, 69, 1)', 'rgba(40, 167, 69, 1)' ], borderWidth: 1 }] }, options: { responsive: true, maintainAspectRatio: false, scales: { y: { beginAtZero: true, ticks: { callback: function(value) { if (value % 1 === 0) { return '$' + value.toLocaleString(); } else { return '$' + value.toFixed(2); } } } } }, plugins: { legend: { display: false // Hide legend as labels are on the x-axis }, tooltip: { callbacks: { label: function(context) { var label = context.dataset.label || "; if (label) { label += ': '; } if (context.parsed.y !== null) { label += '$' + context.parsed.y.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 }); } return label; } } } } } }); } function updateChart(revenue, expenses, netProfit) { if (!earningsChart) { initializeChart(); } earningsChart.data.datasets[0].data = [revenue, expenses, netProfit]; earningsChart.update(); } function validateInput(id, errorId, min, max) { var input = document.getElementById(id); var errorElement = document.getElementById(errorId); var value = parseFloat(input.value); errorElement.style.display = 'none'; // Hide error by default if (input.value === "") { errorElement.textContent = "This field cannot be empty."; errorElement.style.display = 'block'; return false; } if (isNaN(value)) { errorElement.textContent = "Please enter a valid number."; errorElement.style.display = 'block'; return false; } if (value < 0) { errorElement.textContent = "Value cannot be negative."; errorElement.style.display = 'block'; return false; } if (min !== undefined && value max) { errorElement.textContent = "Value cannot exceed " + max + "."; errorElement.style.display = 'block'; return false; } return true; } function calculateMileagePay() { var milesDrivenValid = validateInput('milesDriven', 'milesDrivenError', 0); var payPerMileValid = validateInput('payPerMile', 'payPerMileError', 0); var fuelCostPerMileValid = validateInput('fuelCostPerMile', 'fuelCostPerMileError', 0); var otherExpensesPerMileValid = validateInput('otherExpensesPerMile', 'otherExpensesPerMileError', 0); if (!milesDrivenValid || !payPerMileValid || !fuelCostPerMileValid || !otherExpensesPerMileValid) { return; } var milesDriven = parseFloat(document.getElementById('milesDriven').value); var payPerMile = parseFloat(document.getElementById('payPerMile').value); var fuelCostPerMile = parseFloat(document.getElementById('fuelCostPerMile').value); var otherExpensesPerMile = parseFloat(document.getElementById('otherExpensesPerMile').value); var totalRevenue = milesDriven * payPerMile; var totalExpenses = (fuelCostPerMile + otherExpensesPerMile) * milesDriven; var netProfit = totalRevenue – totalExpenses; // Ensure net profit is not negative for display, but show calculation var displayNetProfit = netProfit < 0 ? 0 : netProfit; var displayGrossEarnings = totalRevenue; // Gross earnings is total revenue document.getElementById('grossEarnings').textContent = '$' + displayGrossEarnings.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 }); document.getElementById('totalRevenue').textContent = 'Total Revenue: $' + totalRevenue.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 }); document.getElementById('totalExpenses').textContent = 'Total Expenses: $' + totalExpenses.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 }); document.getElementById('netProfit').textContent = 'Net Profit: $' + netProfit.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 }); // Update table document.getElementById('tableMilesDriven').textContent = milesDriven.toLocaleString() + ' miles'; document.getElementById('tablePayPerMile').textContent = '$' + payPerMile.toFixed(2); document.getElementById('tableFuelCostPerMile').textContent = '$' + fuelCostPerMile.toFixed(2); document.getElementById('tableOtherExpensesPerMile').textContent = '$' + otherExpensesPerMile.toFixed(2); document.getElementById('tableTotalRevenue').textContent = '$' + totalRevenue.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 }); document.getElementById('tableTotalExpenses').textContent = '$' + totalExpenses.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 }); document.getElementById('tableNetProfit').textContent = '$' + netProfit.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 }); // Update chart updateChart(totalRevenue, totalExpenses, netProfit); } function resetCalculator() { document.getElementById('milesDriven').value = '2500'; document.getElementById('payPerMile').value = '0.55'; document.getElementById('fuelCostPerMile').value = '0.22'; document.getElementById('otherExpensesPerMile').value = '0.13'; // Clear errors document.getElementById('milesDrivenError').style.display = 'none'; document.getElementById('payPerMileError').style.display = 'none'; document.getElementById('fuelCostPerMileError').style.display = 'none'; document.getElementById('otherExpensesPerMileError').style.display = 'none'; calculateMileagePay(); // Recalculate with defaults } function copyResults() { var milesDriven = document.getElementById('milesDriven').value; var payPerMile = document.getElementById('payPerMile').value; var fuelCostPerMile = document.getElementById('fuelCostPerMile').value; var otherExpensesPerMile = document.getElementById('otherExpensesPerMile').value; var grossEarnings = document.getElementById('grossEarnings').textContent; var totalRevenue = document.getElementById('totalRevenue').textContent; var totalExpenses = document.getElementById('totalExpenses').textContent; var netProfit = document.getElementById('netProfit').textContent; var assumptions = document.getElementsByClassName('key-assumptions')[0].textContent.replace('Key Assumptions:', 'Key Assumptions:\n'); var textToCopy = "— Truck Driver Mileage Pay Calculation —" + "\n\n"; textToCopy += "Inputs:\n"; textToCopy += "- Total Miles Driven: " + milesDriven + "\n"; textToCopy += "- Pay Per Mile: $" + payPerMile + "\n"; textToCopy += "- Fuel Cost Per Mile: $" + fuelCostPerMile + "\n"; textToCopy += "- Other Expenses Per Mile: $" + otherExpensesPerMile + "\n\n"; textToCopy += "Results:\n"; textToCopy += "- Gross Earnings: " + grossEarnings + "\n"; textToCopy += "- " + totalRevenue + "\n"; textToCopy += "- " + totalExpenses + "\n"; textToCopy += "- " + netProfit + "\n\n"; textToCopy += assumptions; // Use a temporary textarea to copy text var tempTextArea = document.createElement("textarea"); tempTextArea.value = textToCopy; document.body.appendChild(tempTextArea); tempTextArea.select(); try { document.execCommand('copy'); alert('Results copied to clipboard!'); } catch (err) { console.error('Failed to copy: ', err); alert('Failed to copy results. Please copy manually.'); } document.body.removeChild(tempTextArea); } // Initialize chart on load document.addEventListener('DOMContentLoaded', function() { initializeChart(); resetCalculator(); // Load default values and calculate // Add event listeners for real-time updates var inputs = document.querySelectorAll('.calculator-wrapper input[type="number"]'); for (var i = 0; i < inputs.length; i++) { inputs[i].addEventListener('input', calculateMileagePay); } }); // FAQ functionality document.addEventListener('DOMContentLoaded', function() { var faqItems = document.querySelectorAll('.faq-item strong'); for (var i = 0; i < faqItems.length; i++) { faqItems[i].addEventListener('click', function() { var p = this.nextElementSibling; if (p.style.display === 'block') { p.style.display = 'none'; } else { p.style.display = 'block'; } }); } });

Leave a Comment