mardi 3 août 2021

Randomize color pairs onclick (CSS, JavaScript)

There is a button on my website that should change the page's background color and the headline text color onclick (simultaneously). What makes it more complex is that the possible color pairs (BG + headline) should be pre-determined, but the pairs themself should be randomized, so each time you click the button you randomly get one of the possible color pairs. Also one should not get the same color pair twice in a row.

How do I do that?




Aucun commentaire:

Enregistrer un commentaire