Your goal is to edit script.js so that the dice roller works.
You will need to create two functions:
- Accept a parameter called
id. - Access the corresponding
<img>element for the die and toggle the attributedata-active. - This attribute starts as
true. - Either add or remove the
"held"class from theclassList:- The class should be
"held"ifdata-activeisfalse. - The class should not be
"held"whendata-activeistrue.
- The class should be
- Generate a random number for each die that has
data-active="true". - Update the
srcandaltattributes of the<img>accordingly.