Sure! Here's an example of a simple fighting game using JavaScript and HTML, where you can control a character's movements and attacks. Please note that this is a basic implementation and lacks the complexity and features of a complete game like Mortal Kombat. Additionally, since the game visuals were not specified in the request, this example assumes the use of ASCII characters for simplicity.
To play the game, copy and paste the above code into a new HTML file (e.g., `fighting_game.html`), then open the file in a web browser. The game canvas will be displayed, and you can control the player's movements using the WASD keys on your keyboard. Attacks can be performed by pressing the number keys 1, 2, and 3. The game ends when either the player's or the opponent's health reaches zero.