Svelte · Junior · Question 47 of 76
How do you set the page title from a component?
- ✓Correct answer:
<svelte:head><title>Settings</title></svelte:head> - 2
document.title = "Settings"in the markup - 3
<title>anywhere in the markup
Explanation
Content of <svelte:head> is inserted into document.head and is also rendered during SSR, which matters for SEO.