JavaScript
javascript:void(0) 含义
以下实例中参数 a 将返回 undefined
源代码:
点击运行 »
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script type="text/javascript"> function getValue() { var a, b, c; a = void(b = 5, c = 7); document.write('a = ' + a + ' b = ' + b + ' c = ' + c); } </script> </head> <body> <p>点击以下按钮查看结果:</p> <form> <input type="button" value="点我" onclick="getValue();" /> </form> </body> </html>
运行结果:
点击运行 »