1. First, open an html editor, create a new html file, such as index.html, and enter the basic code of the question.
2. In index.html
fun() {
Alert ('Click succeeded!' );
}
3. When the browser runs the index.html page, click the button to pop up a prompt box.