|
|
To print special characters like the Copyright symbol © or a Trademark ™ using JavaScript, use escape sequences.
For example, to print the Copyright symbol ©, use this code:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Print Special Characters using JavaScript</title>
</head>
<body>
<div id="divOne" />
<script type="text/javascript">
var str = "Copyright \u00A9 DevCurry.com";
document.getElementById('divOne').innerHTML = str;
</script>
</body>
</html>
Check some more Character Entity References over here. Note that escape sequences in JavaScript begins with a backslash character (\) like \u00A9 and so on.
OUTPUT
'Like' us on our FaceBook page if you find this blog useful. Thanks!
Did you like this post?
|
|
|
||
|
|
|
|
Save on Delicious |
|
|
subscribe via rss |
|
subscribe via e-mail |
|
|
print this post |
|
follow me on twitter |




comments
1 Response to "Print Special Characters like the Copyright Symbol using JavaScript"hihihi
thanks a lot my friend ^^
Post a Comment