Beginner
A profile card from data
The user object holds the data. Fill the card with curly braces so it shows the data, not fixed text:
An <h2 id="name"> with the full name (first and last with a space between). An <img> whose src is user.photo and whose alt is Photo of followed by the full name. A <p id="age"> saying Age: and the age, calculated as THIS_YEAR - user.born. A <p id="status"> saying Online with the classes status online when user.online is true, otherwise Offline with the classes status offline.
Then change the data (for example online: false) and check that the card follows.
What Check tests
- The heading shows
Asha Rao - The image uses
user.photoand the alt textPhoto of Asha Rao - The age is calculated:
Age: 12 - The status says
Onlinewith the classesstatus online - The values come from
user, not typed in
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Runs in your browser. Your code is saved here.
Your page
Press Run to see the page.
Console
Nothing logged yet.