mobile-first workflow
This is a solution to the Advice generator app challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Note: Delete this note and update the table of contents based on what sections you keep.
Users should be able to:
- Semantic HTML5 markup
- CSS custom properties
- Mobile-first workflow
- JavaScript
fetch API
const fetchAdvice = async() => {
const res = await fetch("https://api.adviceslip.com/advice")
const data = await res.json()
console.log(data)
document.getElementById("title").innerHTML = `Advice #${data.slip.id}`
document.getElementById("text").innerHTML = `"${data.slip.advice}"`
}
fetchAdvice()