I made a function that brings a popup message on click if a button The first file I added a form to the button that was to trigger the popup message The default action of the form did not allow the popup message to dropdown and stay long enough for another button that had the closepopup function to be triggered by the click of a button I added an event listener to prevent the default action of the form. This allowed the popup message to open and stay. The popup message is then removed by the click of another button The second file has only a submit button that triggers the popup message to open I added comments to the code for better understanding I also did internal styling and JS