Sure! Here's an example of a simple text-based fighting game using JavaScript and HTML:
In this game, the player can input their chosen attack by typing the text of the attack, such as "Punch", "Kick", etc. The enemy's attack is randomly chosen from the available attacks.
The game consists of 20 rounds, with each fighter (player and enemy) starting with 10 health points. Damage dealt by each attack is calculated randomly between 1 and 4. After each round, the game displays the results and the updated health of both fighters. The game continues until all rounds are completed or either fighter's health reaches zero.
At the end of the game, the winner is determined based on the remaining health of the fighters. If both fighters have zero health, it's a tie. Otherwise, the fighter with remaining health wins.
Please note that this is a simple example and can be further enhanced with more features, graphics, and animations.