Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> JavaScript

วิธีแสดงยูโร (€) หรือ HTML Entity ใน JavaScript Alert

ได้ ใช้ Unicode Character ของ Euro คือ \u20AC

ตัวอย่าง

<!DOCTYPE html> <html> 
  <body> 
    <script> 
      alert("\u20AC"); 
      document.write("\u20AC"); 
    </script> 
    <p>Printing the Euro sign above.</p> 
  </body> 
</html>