源代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>编程字典</title> </head> <body> <button type="button" autofocus onclick="alert('Hello world!')">Click Me!</button> <p><strong>注意:</strong> IE 9和更早的版本不支持按钮的 autofocus 属性.</p> </body> </html>
运行结果