I embedded below code into my google sites page. for some reason the alert window is not popping up.
<form xmlns="myform">
<input id="HelloWorld" onClick="alert('Hi')" type="button" value="HelloWorld"/>
</form>
I tried the code in W3school code editor site and its works. Pictures attached.

google actively blocks stuff like popups in JS and maybe some HMTL implementations. I found a post here andk8omsmentioned his CSS and HTML version works. Check out their write up for a solution [k80ms blog post][2].[2]: https://www.k8oms.net/document/popup
My apologies on the late edit.
Use JS to
getElelementByIDand select a visible/hidden element on myPopup to "show / hide" your window.popupWindow.jsNext you need to style your window with CSS something very basic would be.
style.cssThen we can create an
onclickto callpopupFunction()from your HTML page.id="myPopup"is the important thing here, this is where JS'sgetElementByIdattaches itself to.This is a very basic way to create an "alert" style popup window. If you were to define a stylized box with CSS that looks like a modern alert box you can call the
<span class="popuptext" id="myPopup">anywhere in your HTML to create a popup window. Areas such as a header or upper banner area would be a good place to add thisspanso it would display in the same spot "top & center" just as an alert box would.