How to show html currency symbol in javascript alert box. I am showing the message where currency and price both are dynamic so i need to get currency from html codes. Please provide me a solution.
<p id="eu">€</p>
<script type="text/javascript">
var txt = document.getElementById("eu").textContent || document.getElementById("eu").innerText;
alert(txt);
</script>
NOTE: HERE you can find html entities
It all depends on which currency sign you want. The generic ¤ CURRENCY SIGN is \\xA4
...
Use \\xA3
to represent £
, \€
to represent €
, and for more just use the handy tool called Character Map.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.