AI Frontend · Exercise 5 of 5 Previous
Advanced
Build the Source List
Two buttons feed a list of source parts to renderSources(parts). #with sends five parts and #without sends none.
Draw an ordered list #sources with one li per distinct address (keep the first, number by first appearance). Use the part's title as the text. Make it a link only if the address is http: or https:. When there are no parts, show #empty with the text This answer is not from the shop's help pages. and no list.
What Check tests
- With sources,
#sourceshas 4 items (the duplicate is dropped) - The items are in order of first appearance
- The
javascript:source is listed without a link - The safe sources are links
- With no sources,
#emptyhas the note and there is no list
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.