W3School TIY
编辑您的代码:
<html> <body> <script type="text/javascript"> var t1="" var t2 if (t1===undefined) {alert("t1 is undefined")} if (t2===undefined) {alert("t2 is undefined")} </script> </body> </html>
查看结果: