How do I make a html button activate javascript? For example, if I make a button and i click it, it activates a javascript code that confirms ("Hi"). Help would be appreciated!
And if you actually want me to give an example, I am new to this and this is what i have tried:
<!DOCTYPE html>
<button type="button">This is the button</button>
<script language="javascript">
confirm("hi")
</script>