Paying off Credit Card Calculator

Free Paying Off Credit Card Calculator – Accelerate Your Debt Payoff :root { –primary-color: #004a99; –success-color: #28a745; –background-color: #f8f9fa; –text-color: #333; –border-color: #ddd; –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: 0; } .container { max-width: 1000px; margin: 20px auto; padding: 20px; background-color: var(–card-background); border-radius: 8px; box-shadow: var(–shadow); } h1, h2, h3 { color: var(–primary-color); text-align: center; margin-bottom: 20px; } h1 { font-size: 2.2em; } h2 { font-size: 1.8em; margin-top: 30px; } h3 { font-size: 1.4em; margin-top: 25px; } .loan-calc-container { background-color: var(–card-background); padding: 25px; 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: 10px; border: 1px solid var(–border-color); border-radius: 4px; font-size: 1em; box-sizing: border-box; } .input-group .helper-text { font-size: 0.85em; color: #666; margin-top: 5px; display: block; } .error-message { color: red; font-size: 0.85em; margin-top: 5px; display: block; min-height: 1.2em; /* Prevent layout shift */ } .button-group { display: flex; justify-content: space-between; margin-top: 25px; flex-wrap: wrap; gap: 10px; } .button-group button { padding: 12px 20px; border: none; border-radius: 5px; cursor: pointer; font-size: 1em; font-weight: bold; transition: background-color 0.3s ease; flex: 1; /* Distribute space */ min-width: 150px; /* Minimum width for buttons */ } .btn-calculate { background-color: var(–primary-color); color: white; } .btn-calculate:hover { background-color: #003366; } .btn-reset { background-color: #ccc; color: #333; } .btn-reset:hover { background-color: #bbb; } .btn-copy { background-color: var(–success-color); color: white; } .btn-copy:hover { background-color: #218838; } #results-container { margin-top: 30px; padding: 25px; background-color: var(–card-background); border-radius: 8px; box-shadow: var(–shadow); } #results-container h3 { margin-top: 0; color: var(–primary-color); } .primary-result { font-size: 2.5em; font-weight: bold; color: var(–success-color); text-align: center; margin-bottom: 20px; padding: 15px; background-color: #e9f7ef; border-radius: 5px; } .intermediate-results div, .key-assumptions div { margin-bottom: 10px; font-size: 1.1em; } .intermediate-results span, .key-assumptions span { font-weight: bold; color: var(–primary-color); } .formula-explanation { font-size: 0.9em; color: #555; margin-top: 15px; padding-top: 15px; border-top: 1px solid var(–border-color); } table { width: 100%; border-collapse: collapse; margin-top: 20px; overflow-x: auto; /* Mobile responsiveness */ display: block; /* Needed for overflow-x */ white-space: nowrap; /* Prevent wrapping in cells */ } th, td { padding: 12px 15px; 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; } #paymentScheduleTable th, #paymentScheduleTable td { white-space: nowrap; /* Ensure cells don't wrap */ } #paymentScheduleTable { overflow-x: auto; display: block; } canvas { max-width: 100%; /* Mobile responsiveness */ height: auto !important; /* Override potential fixed height */ display: block; /* Remove extra space below canvas */ margin: 20px auto; border: 1px solid var(–border-color); border-radius: 4px; } .chart-container { position: relative; width: 100%; margin-top: 20px; } .article-section { margin-top: 40px; padding-top: 20px; border-top: 1px solid #eee; } .article-section:first-of-type { border-top: none; padding-top: 0; margin-top: 0; } .article-section p, .article-section ul, .article-section ol { margin-bottom: 15px; } .article-section ul, .article-section ol { padding-left: 25px; } .article-section li { margin-bottom: 8px; } .faq-item { margin-bottom: 15px; border-bottom: 1px dashed #ddd; padding-bottom: 10px; } .faq-item:last-child { border-bottom: none; } .faq-question { font-weight: bold; color: var(–primary-color); cursor: pointer; display: block; margin-bottom: 5px; } .faq-answer { display: none; padding-left: 10px; font-size: 0.95em; color: #555; } .faq-question::after { content: ' +'; float: right; font-size: 1.2em; } .faq-question.active::after { content: ' -'; } .related-links ul { list-style: none; padding: 0; } .related-links li { margin-bottom: 10px; } .related-links a { color: var(–primary-color); text-decoration: none; font-weight: bold; } .related-links a:hover { text-decoration: underline; } .related-links span { font-size: 0.9em; color: #555; display: block; margin-top: 3px; } /* Responsive adjustments */ @media (max-width: 768px) { .container { margin: 10px; padding: 15px; } h1 { font-size: 1.8em; } h2 { font-size: 1.5em; } h3 { font-size: 1.2em; } .button-group button { flex: 1 1 100%; /* Stack buttons on small screens */ min-width: unset; } .primary-result { font-size: 2em; } table, canvas { max-width: 100%; overflow-x: auto; /* Ensure scrollability */ display: block; /* For overflow-x */ } th, td { padding: 8px 10px; } }

Free Paying Off Credit Card Calculator

Quickly estimate how long it will take to pay off your credit card debt and see the impact of different payment amounts.

Credit Card Payoff Calculator

Enter the total amount you owe on the credit card.
Enter the Annual Percentage Rate (APR) for your card.
Enter the amount you plan to pay each month.

Your Payoff Results

Total Interest Paid:
Months to Pay Off:
Total Amount Paid:
How it's calculated: This calculator uses an iterative process to determine the number of months required to pay off the credit card debt. Each month, interest is calculated on the remaining balance, added to the balance, and then your monthly payment is subtracted. This continues until the balance reaches zero. The total interest paid is the sum of all monthly interest charges.

Payment Schedule Breakdown

Monthly Payment Details
Month Starting Balance Interest Paid Principal Paid Ending Balance

What is a Paying Off Credit Card Calculator?

A paying off credit card calculator is a specialized financial tool designed to help individuals understand the timeline and total cost associated with eliminating their credit card debt. By inputting key details such as the current balance, the annual interest rate (APR), and the amount you plan to pay each month, the calculator provides an estimated payoff date, the total interest you'll accrue, and the total amount you'll ultimately spend to become debt-free. This tool is invaluable for anyone looking to gain control over their finances and develop a strategic plan to tackle credit card balances efficiently. It demystifies the often-confusing world of credit card interest and payment structures, offering clear, actionable insights.

Who should use it: Anyone with credit card debt can benefit from using a paying off credit card calculator. This includes individuals who are struggling to make progress on their balances, those who want to see the impact of increasing their monthly payments, or people who are simply curious about how long it will take to become debt-free. It's particularly useful for those with multiple credit cards, as it can help prioritize which card to pay off first (a strategy known as the debt snowball or debt avalanche method).

Common misconceptions: A frequent misconception is that only paying the minimum amount due is sufficient. While this keeps your account in good standing, it often leads to paying significantly more in interest over a much longer period. Another misconception is that credit card interest rates are fixed; while the APR might be stated, it can change, especially for variable-rate cards. This calculator assumes a fixed rate for simplicity, but users should be aware of potential rate changes. Finally, some believe that paying off debt quickly isn't important if they can "afford" the minimum payments, overlooking the substantial long-term financial drain that high-interest debt represents.

Paying Off Credit Card Calculator Formula and Mathematical Explanation

The core of the paying off credit card calculator relies on an iterative calculation that simulates the debt repayment process month by month. It doesn't use a single, simple formula like a loan amortization formula for the total payoff time because the payment amount is fixed, and we need to track the balance reduction precisely. Instead, it's a step-by-step simulation.

Here's the process:

  1. Calculate Monthly Interest Rate: The annual interest rate (APR) is divided by 12 to get the monthly interest rate.
    Monthly Interest Rate = Annual Interest Rate / 12
  2. Calculate Monthly Interest Charge: Interest is charged on the current balance.
    Interest Charge = Current Balance * Monthly Interest Rate
  3. Calculate Principal Paid: The portion of the monthly payment that goes towards reducing the principal balance.
    Principal Paid = Monthly Payment - Interest Charge
  4. Calculate New Balance: The balance remaining after the payment is applied.
    New Balance = Current Balance - Principal Paid
  5. Repeat: Steps 2-4 are repeated with the new balance until the balance is zero or less. The number of iterations is the number of months to pay off the debt.

The total interest paid is the sum of all the monthly interest charges calculated throughout the repayment period. The total amount paid is the sum of all monthly payments made (or the final smaller payment if applicable).

Variables Used:

Variables in the Paying Off Credit Card Calculator
Variable Meaning Unit Typical Range
Current Balance (B) The outstanding amount owed on the credit card. Currency (e.g., USD) $100 – $100,000+
Annual Interest Rate (APR) The yearly interest rate charged on the balance. Percentage (%) 5% – 30%+
Monthly Payment (P) The fixed amount paid towards the debt each month. Currency (e.g., USD) Minimum Payment – $1,000+
Monthly Interest Rate (r) The interest rate applied each month. Decimal (e.g., 0.01667 for 20% APR) 0.004 – 0.025+
Months to Pay Off (n) The total number of months required to eliminate the debt. Months 1 – 120+
Total Interest Paid (I) The cumulative interest paid over the life of the debt repayment. Currency (e.g., USD) $0 – $50,000+
Total Amount Paid (T) The sum of all monthly payments made. Currency (e.g., USD) $0 – $150,000+

Practical Examples

Let's explore how the paying off credit card calculator can be used in real-world scenarios:

Example 1: Standard Payoff Scenario

Scenario: Sarah has a credit card with a balance of $8,000 and an APR of 21.99%. She can afford to pay $200 per month.

Inputs:

  • Current Balance: $8,000
  • Annual Interest Rate: 21.99%
  • Monthly Payment: $200

Calculator Output (Estimated):

  • Months to Pay Off: Approximately 65 months
  • Total Interest Paid: Approximately $4,915
  • Total Amount Paid: Approximately $12,915

Financial Interpretation: Sarah will be debt-free in just over 5 years. However, she will end up paying nearly $5,000 in interest alone, almost doubling the original amount she owed. This highlights the significant cost of carrying high-interest debt.

Example 2: Aggressive Payoff Strategy

Scenario: John has a credit card with a balance of $5,000 and an APR of 17.50%. He decides to increase his monthly payment from the minimum to $300.

Inputs:

  • Current Balance: $5,000
  • Annual Interest Rate: 17.50%
  • Monthly Payment: $300

Calculator Output (Estimated):

  • Months to Pay Off: Approximately 19 months
  • Total Interest Paid: Approximately $745
  • Total Amount Paid: Approximately $5,745

Financial Interpretation: By paying an extra $100 per month (compared to a hypothetical $200 payment), John cuts his payoff time by more than half (from potentially 30+ months down to 19 months) and saves over $1,000 in interest. This demonstrates the power of increasing payments, even modestly.

How to Use This Paying Off Credit Card Calculator

Using the paying off credit card calculator is straightforward and designed for ease of use. Follow these simple steps to get your personalized debt payoff projection:

  1. Enter Your Current Balance: In the "Current Balance" field, input the exact amount you currently owe on your credit card.
  2. Input Your Annual Interest Rate (APR): Enter the Annual Percentage Rate (APR) associated with your credit card. This is usually found on your credit card statement. Ensure you enter it as a percentage (e.g., 19.99 for 19.99%).
  3. Specify Your Monthly Payment: In the "Monthly Payment" field, enter the amount you commit to paying towards this debt each month. Be realistic about what you can consistently afford.
  4. Click "Calculate Payoff": Once all fields are populated, click the "Calculate Payoff" button.

How to Read Results:

  • Primary Result (Months to Pay Off): This is the most prominent number, showing the estimated number of months it will take to completely pay off your credit card debt based on your inputs.
  • Total Interest Paid: This figure represents the total amount of interest you will pay over the entire duration of your debt repayment.
  • Total Amount Paid: This is the sum of your original balance plus all the interest paid.
  • Payment Schedule Table: This table provides a month-by-month breakdown, showing how much of each payment goes towards interest versus principal, and how your balance decreases over time.
  • Chart: The chart visually represents the progress of your debt reduction and the proportion of interest versus principal paid over time.

Decision-Making Guidance: Use the results to motivate yourself. If the payoff timeline seems too long or the total interest is high, consider increasing your monthly payment. Even a small increase can significantly shorten the payoff period and save you money. You can use the "Reset" button to try different payment amounts and see their impact. The "Copy Results" button allows you to save or share your projections.

Key Factors That Affect Paying Off Credit Card Results

Several crucial factors significantly influence how quickly you can pay off credit card debt and the total cost involved. Understanding these elements is key to effective debt management:

  1. Interest Rate (APR): This is arguably the most impactful factor. A higher APR means more of your payment goes towards interest, slowing down principal reduction and increasing the total cost. Cards with lower APRs allow you to pay off debt faster and cheaper. Consider balance transfer credit cards or personal loans with lower rates if possible.
  2. Monthly Payment Amount: The more you pay each month above the minimum, the faster you'll pay off the debt and the less interest you'll accrue. Even small increases can make a substantial difference over time due to the power of compounding interest working against you.
  3. Starting Balance: A larger initial balance naturally takes longer and costs more to pay off, assuming all other factors remain constant. Prioritizing high-balance cards or using debt reduction strategies becomes more critical.
  4. Fees: Credit cards often come with various fees, such as annual fees, late payment fees, over-limit fees, and balance transfer fees. These fees add to the overall cost of carrying debt and should be factored into your financial planning. Some fees can be avoided by managing your account responsibly.
  5. Payment Consistency: Making consistent, on-time payments is vital. Late payments not only incur fees but can also lead to penalty APRs, significantly increasing your interest rate and slowing down payoff progress.
  6. Spending Habits: If you continue to add to your credit card balance while trying to pay it off, your progress will be severely hampered. It's crucial to curb new spending on the card(s) you're targeting for payoff.
  7. Promotional/Introductory APRs: Many cards offer 0% introductory APR periods. While beneficial for new purchases or balance transfers, be aware of the regular APR that kicks in after the promotional period ends. Failing to pay off the balance before this happens can lead to substantial interest charges.

Frequently Asked Questions (FAQ)

How accurate is this paying off credit card calculator?
The calculator provides an excellent estimate based on the inputs you provide. However, it assumes a fixed interest rate and consistent monthly payments. If your APR changes (e.g., after a promotional period or due to variable rates) or if your payment amount fluctuates, the actual payoff time and total interest paid may differ.
What is the minimum payment on a credit card?
The minimum payment is the smallest amount you can pay each month without incurring a late fee. It's typically calculated as a small percentage of the balance plus interest and fees, or a flat amount (e.g., $25), whichever is greater. Paying only the minimum can lead to decades of repayment and significantly higher interest costs.
Should I pay off my credit card with the highest balance first or the highest interest rate first?
This is a strategic decision. Paying off the card with the highest interest rate first (the "debt avalanche" method) saves you the most money on interest over time. Paying off the card with the smallest balance first (the "debt snowball" method) can provide quicker psychological wins and motivation. Both are effective strategies.
What happens if I miss a payment?
Missing a payment can result in late fees, a penalty APR (which is often much higher than your regular APR), and negative reporting to credit bureaus, damaging your credit score. It also extends your payoff timeline and increases the total interest paid.
Can I use this calculator for multiple credit cards?
This calculator is designed for one credit card at a time. To manage multiple cards, you can use the calculator individually for each card to understand their payoff scenarios. Alternatively, you could sum up balances and average interest rates for a rough estimate, but individual calculations are more accurate. Many people use strategies like the debt avalanche or snowball method, which involve prioritizing one card while making minimum payments on others.
What is a balance transfer?
A balance transfer involves moving debt from one credit card to another, often one with a lower or 0% introductory APR. This can be a powerful tool to save on interest while paying down debt, but be mindful of balance transfer fees and the APR after the introductory period ends.
How does paying off credit card debt affect my credit score?
Paying off credit card debt positively impacts your credit score. It reduces your credit utilization ratio (the amount of credit you're using compared to your total available credit), which is a major factor in credit scoring. It also demonstrates responsible credit management.
What if my monthly payment is less than the interest accrued that month?
If your monthly payment is less than the interest charged for that month, your balance will actually increase, not decrease. This is a critical situation often referred to as being "upside down" on your debt. The calculator will show a very long payoff time or potentially an error if the payment is too low to cover interest. It's essential to increase your payment to at least cover the monthly interest plus a small amount of principal.

© 2023 Your Financial Website. All rights reserved.

function getElement(id) { return document.getElementById(id); } function formatCurrency(amount) { return "$" + amount.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,'); } function formatNumber(num) { return num.toFixed(2); } function validateInput(value, id, errorId, min = -Infinity, max = Infinity) { var errorElement = getElement(errorId); errorElement.textContent = "; if (value === ") { errorElement.textContent = 'This field cannot be empty.'; return false; } var numValue = parseFloat(value); if (isNaN(numValue)) { errorElement.textContent = 'Please enter a valid number.'; return false; } if (numValue max) { errorElement.textContent = 'Value is too high.'; return false; } return true; } var chartInstance = null; function calculatePayoff() { var currentBalance = parseFloat(getElement("currentBalance").value); var annualInterestRate = parseFloat(getElement("annualInterestRate").value); var monthlyPayment = parseFloat(getElement("monthlyPayment").value); var balanceError = getElement("currentBalanceError"); var rateError = getElement("annualInterestRateError"); var paymentError = getElement("monthlyPaymentError"); var isValid = true; if (!validateInput(currentBalance, "currentBalance", "currentBalanceError", 0)) isValid = false; if (!validateInput(annualInterestRate, "annualInterestRate", "annualInterestRateError", 0, 100)) isValid = false; if (!validateInput(monthlyPayment, "monthlyPayment", "monthlyPaymentError", 0)) isValid = false; if (!isValid) { clearResults(); return; } var monthlyInterestRate = annualInterestRate / 100 / 12; var balance = currentBalance; var months = 0; var totalInterestPaid = 0; var totalAmountPaid = 0; var paymentSchedule = []; // Check if monthly payment is enough to cover interest var initialInterest = balance * monthlyInterestRate; if (monthlyPayment 0) { paymentError.textContent = 'Monthly payment is too low to cover interest. Balance will increase.'; clearResults(); return; } else { paymentError.textContent = "; // Clear error if payment is sufficient } while (balance > 0) { months++; var interestCharge = balance * monthlyInterestRate; totalInterestPaid += interestCharge; var principalPaid = monthlyPayment – interestCharge; if (principalPaid > balance) { // Handle final payment principalPaid = balance; monthlyPayment = interestCharge + principalPaid; // Adjust final payment amount } balance -= principalPaid; totalAmountPaid += monthlyPayment; paymentSchedule.push({ month: months, startingBalance: balance + principalPaid, // Balance before this month's payment interestPaid: interestCharge, principalPaid: principalPaid, endingBalance: balance 10000) { // Safety break for extremely long payoffs alert("Calculation exceeded maximum iterations. Please check your inputs."); clearResults(); return; } } // Display primary result getElement("primaryResult").textContent = months + " Months"; // Display intermediate results getElement("totalInterestPaid").querySelector('span').textContent = formatCurrency(totalInterestPaid); getElement("monthsToPayoff").querySelector('span').textContent = months; getElement("totalAmountPaid").querySelector('span').textContent = formatCurrency(currentBalance + totalInterestPaid); // Populate payment schedule table var tableBody = getElement("paymentScheduleTable").querySelector('tbody'); tableBody.innerHTML = "; // Clear previous rows var scheduleLimit = 120; // Limit table rows for performance/readability for (var i = 0; i < paymentSchedule.length && i scheduleLimit) { var row = tableBody.insertRow(); row.insertCell(0).colSpan = 5; row.insertCell(1).textContent = "… and so on until payoff."; row.style.fontStyle = 'italic'; row.style.textAlign = 'center'; } // Update Chart updateChart(paymentSchedule); } function updateChart(paymentSchedule) { var ctx = getElement('payoffChart').getContext('2d'); // Destroy previous chart instance if it exists if (chartInstance) { chartInstance.destroy(); } var labels = []; var principalData = []; var interestData = []; var scheduleLimit = 60; // Limit data points for chart clarity for (var i = 0; i < paymentSchedule.length && i < scheduleLimit; i++) { labels.push("Month " + paymentSchedule[i].month); principalData.push(paymentSchedule[i].principalPaid); interestData.push(paymentSchedule[i].interestPaid); } chartInstance = new Chart(ctx, { type: 'bar', // Use bar chart for better visualization of monthly breakdown data: { labels: labels, datasets: [{ label: 'Principal Paid', data: principalData, backgroundColor: 'rgba(0, 74, 153, 0.6)', // Primary color variation borderColor: 'rgba(0, 74, 153, 1)', borderWidth: 1 }, { label: 'Interest Paid', data: interestData, backgroundColor: 'rgba(40, 167, 69, 0.6)', // Success color variation borderColor: 'rgba(40, 167, 69, 1)', borderWidth: 1 }] }, options: { responsive: true, maintainAspectRatio: false, scales: { y: { beginAtZero: true, title: { display: true, text: 'Amount ($)' } }, x: { title: { display: true, text: 'Month' } } }, plugins: { legend: { position: 'top', }, title: { display: true, text: 'Monthly Principal vs. Interest Payments' } } } }); } function clearResults() { getElement("primaryResult").textContent = "–"; getElement("totalInterestPaid").querySelector('span').textContent = "–"; getElement("monthsToPayoff").querySelector('span').textContent = "–"; getElement("totalAmountPaid").querySelector('span').textContent = "–"; getElement("paymentScheduleTable").querySelector('tbody').innerHTML = ''; if (chartInstance) { chartInstance.destroy(); chartInstance = null; } // Clear error messages getElement("currentBalanceError").textContent = ''; getElement("annualInterestRateError").textContent = ''; getElement("monthlyPaymentError").textContent = ''; } function resetCalculator() { getElement("currentBalance").value = "5000"; getElement("annualInterestRate").value = "18.99"; getElement("monthlyPayment").value = "150"; clearResults(); calculatePayoff(); // Recalculate with defaults } function copyResults() { var primaryResult = getElement("primaryResult").textContent; var totalInterest = getElement("totalInterestPaid").querySelector('span').textContent; var monthsToPayoff = getElement("monthsToPayoff").querySelector('span').textContent; var totalAmountPaid = getElement("totalAmountPaid").querySelector('span').textContent; var assumptions = "Key Assumptions:\n"; assumptions += "- Current Balance: " + formatCurrency(parseFloat(getElement("currentBalance").value.replace(/,/g, ''))) + "\n"; assumptions += "- Annual Interest Rate: " + getElement("annualInterestRate").value + "%\n"; assumptions += "- Monthly Payment: " + formatCurrency(parseFloat(getElement("monthlyPayment").value.replace(/,/g, ''))) + "\n"; var resultsText = "— Credit Card Payoff Results —\n\n"; resultsText += "Payoff Time: " + primaryResult + "\n"; resultsText += "Total Interest Paid: " + totalInterest + "\n"; resultsText += "Total Amount Paid: " + totalAmountPaid + "\n\n"; resultsText += assumptions; // Use a temporary textarea to copy text var textArea = document.createElement("textarea"); textArea.value = resultsText; textArea.style.position = "fixed"; textArea.style.left = "-9999px"; document.body.appendChild(textArea); textArea.focus(); textArea.select(); try { var successful = document.execCommand('copy'); var msg = successful ? 'Results copied!' : 'Copying failed!'; // Optionally show a temporary message to the user var copyButton = document.querySelector('.btn-copy'); var originalText = copyButton.textContent; copyButton.textContent = msg; setTimeout(function() { copyButton.textContent = originalText; }, 2000); } catch (err) { console.error('Fallback: Oops, unable to copy', err); } document.body.removeChild(textArea); } // Initialize calculator on page load document.addEventListener('DOMContentLoaded', function() { calculatePayoff(); // FAQ toggles var faqQuestions = document.querySelectorAll('.faq-question'); faqQuestions.forEach(function(question) { question.addEventListener('click', function() { var answer = this.nextElementSibling; this.classList.toggle('active'); if (answer.style.display === 'block') { answer.style.display = 'none'; } else { answer.style.display = 'block'; } }); }); });

Leave a Comment