Benefits Enrollment Dashboard
Total Per Pay Period
$0.00
This is your estimated pre-tax cost per paycheck.Your Enrollment Summary
Your selections will appear here.
${categoryData.details}
` + categoryData.plans.map(plan => `
`).join('') + `
`;
}
selectionContainer.innerHTML += `
${categoryData.title}
${contentHTML}Make selections in the 'Plan Selection' tab.
`;
}
totalCostEl.textContent = `$${totalCost.toFixed(2)}`;
}
// --- EVENT HANDLERS --- //
selectionContainer.addEventListener('change', (e) => {
if (e.target.type === 'radio') {
const category = e.target.name;
userSelections[category] = e.target.value;
renderPlanSelection(); // Re-render to update 'selected' class
renderDashboard();
} else if (e.target.id === 'bed-401k-slider') {
const value = parseFloat(e.target.value);
userSelections['401k_contribution'] = value;
document.getElementById('bed-401k-output').textContent = `${value}%`;
renderDashboard();
}
});
pdfDownloadBtn.addEventListener('click', async () => {
const { jsPDF } = window.jspdf;
const pdfOutput = document.getElementById('bed-pdf-output');
const dashboardContent = document.getElementById('bed-dashboard-content-for-pdf');
if (!pdfOutput || !dashboardContent || !window.html2canvas || !jsPDF) return;
// Clone dashboard content into the hidden PDF container for clean rendering
pdfOutput.innerHTML = `