Computer >> Computer tutorials >  >> Programming >> Javascript

How can I show a euro or other HTML entity in JavaScript alert windows?


Yes, use the Unicode Character of Euro i.e. “20AC” to print it.

Example

You can try to run the following code to print the Euro character −

Live Demo

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