How do I convert this HTML button to Javascript?

I am working on a WordPress website.

I have written an HTML sequence that creates a button that disappears when clicked and brings up a pop_up form for users to fill out:
<a href class="sg-popup-id-12368"><button onclick="style.display=('none')" style="width: 170px; height: 55px; background-color: black; position: relative; left: 100px; top: 386px;" type="button"></button></a>
I currently have this in the text editor of the pages I want; however, when I switch from text view to visual it discards the parts of the code that I need for the whole thing to work.

I need to move this to the backend of the site in the php files. I only want the button to appear on certain pages. I know that I can use if(window.location.href = ("")){} to check if the current webpage is the one I want to run the function on, but after than I’m not sure how to code the button inside the if statement so that it appears and work.
Any suggestions or ideas?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.