Homework
Battle of the bands
Part 1
Create a web page that shows a list of band names. Add a 'like' button next to each of them. The button doesn't need to do anything yet.
Here's a list to get you started:
Part 2
Create a liked bands list which has true
or false
for each band based on whether you like the band or not.
If a band is liked (has a true
entry in the liked bands list) make the 'like' button appear as an 'unlike' button.
Make the 'like'/'unlike' buttons change the appropriate item in the liked bands list to false
/true
on click.
Part 3
At the top of the page:
add a button which shows only liked bands
add a button which shows all of the bands
Extensions
Add a
while
loop that prompts the user to enter a band and stops when there are no bandsYou might want to start with an empty list of bands
Make a button which filters by genre
You'll need to create a list which has the genre for each band in the same order as the
bands
list(just assume each only has 1 genre for now)You can use
indexOf
to figure out where the genre is for a particular band
Allow users to add their own choice of band
Show the list of liked bands and allow users to change the position of each band.
Add an 'up' and 'down' button for each band in the user's favourite list.
Be creative!
Last updated
Was this helpful?