如何在JavaScript警报窗口中显示欧元或其他HTML实体?
是的,使用欧元的Unicode字符(即“20AC”)进行打印。
示例
您可以尝试运行以下代码以打印欧元字符-
<!DOCTYPE html> <html> <body> <script> alert("\u20AC"); document.write("\u20AC"); </script> <p>Printing the Euro sign above.</p> </body> </html>
是的,使用欧元的Unicode字符(即“20AC”)进行打印。
您可以尝试运行以下代码以打印欧元字符-
<!DOCTYPE html> <html> <body> <script> alert("\u20AC"); document.write("\u20AC"); </script> <p>Printing the Euro sign above.</p> </body> </html>