Rate how well you typically address these aspects of your physical health (1 – rarely/not at all, 5 – often/very well):
// Calculate the average score (assuming there are 5 sliders) const averageScore = (Number(eatHealthyValue) + Number(enoughSleepValue) + /* ... add other values */) / 5;
// Store the score (can be used to display results or generate tips on the next page) console.log("Average Physical Self-Care Score:", averageScore);
// You can also redirect to the next page here (e.g., results page) }
const sliderInputs = document.querySelectorAll('input[type="range"]'); // Select all slider elements
sliderInputs.forEach(slider => { slider.oninput = function() { // Update the slider value display as the user interacts with the slider this.nextElementSibling.textContent = this.value; } });