getElementById
getElementById
document.getElementById selects one element by its exact ID value. You pass the ID name itself, without the # used in CSS selectors.
This is useful when the markup gives an important element a stable ID, such as a status message, form field, or action button.
Your task: Select the sync status with getElementById, store it in syncStatus, and update its text so the page shows Synced.
Free with a JS Exercises account
Sign in to start coding, run your solution, and keep your progress saved for later. No payment needed.
By continuing, you agree to our Terms and Privacy Policy. We'll send occasional product updates and news. You can unsubscribe anytime.
getElementById
document.getElementById selects one element by its exact ID value. You pass the ID name itself, without the # used in CSS selectors.
This is useful when the markup gives an important element a stable ID, such as a status message, form field, or action button.
Your task: Select the sync status with getElementById, store it in syncStatus, and update its text so the page shows Synced.