如何在警告框中显示 JavaScript 变量值?
javascriptweb developmentfront end technology
要在警告框中显示 JavaScript 变量值,请尝试运行以下代码 −
示例
<html> <head> <script> function display() { var a = "Simple"; var b = "Learning"; alert(a +" Easy "+ b); } </script> </head> <body> <input type="button" value="Click me!" onClick="display();"> </body> </html>