mardi 29 juin 2021

how to run html code when i click on a button

I have to make a website for school and I have chosen to make a fake webshop. I want to make a button run code but i cant find out how to do it.

The button's code:

<button style="
text-decoration: none;
font-size: x-large;
color: white;
background-color: blue;
position: absolute;
top: 80%;
left: 10%;
width: 20%;
height: 10%;
right: 70%;
bottom: 10%;
">
buy
</button>

The code that need to be run:

alert("out of stock")



Aucun commentaire:

Enregistrer un commentaire