I'm new to Js and im having some issues with an onclick function. Ive added a button on HTML and then I wanted to make a popup window appear after clicking that button but I just can`t get it right on the js side.
Here are the codes:
HTML
<button class="boton1" onclick="mostrarMensaje()">
<span class="popuptext1" id="myPopup1">Conector PS/2</span>
<img src="./images/boton2.png" class="img1">
</button>
JS
$("#boton1").on("click", mostrarMensaje());
function mostrarMensaje() {
$("#popuptext1").trigger("show");
}