I am currently working on a JavaScript, HTML, CSS, and Bootstrap project for a tennis club. The project includes a login page (index.html) and a manage player page. Within the manage player page, there are two buttons - add players and show players. When the show players button is clicked, I want to display the data in a table. However, I'm facing an issue where clicking the button multiple times results in generating new tables below the previous ones without clearing them.
Below you will find the code files and screenshots for reference:
managePlayers.html
<!DOCTYPE html>
<html lang="en">
<!-- Code omitted for brevity -->
</body>
</html>
index.js
Screenshots
https://i.sstatic.net/hmlTP.png
https://i.sstatic.net/hmb9f.png
https://i.sstatic.net/DFATA.png
If anyone has a solution to this issue, please let me know. Thank you!