Live link =>> https://simple-two-player-dice-game.netlify.app
HTML:
The HTML structure includes a container div with headings for the game title and players, dice display areas, a button to roll the dice, and a div to display the winner message. The JavaScript file is linked at the end of the body.
CSS:
Basic styles for the body, container, headings, player areas, dice display, button, and winner message are defined. The layout is centered with a white background for the container.
JavaScript:
An event listener is added to the button, which triggers a function to roll the dice for both players. A random number between 1 and 6 is generated for each player. The dice results are displayed in the corresponding dice divs. The winner is determined by comparing the dice rolls, and the result is displayed in the winner div.