Link to home
Start Free TrialLog in
Avatar of hankknight
hankknightFlag for Canada

asked on

JavaScript: Entity in document.title

How can I add a dash to my document.title using JavaScript?
<script type="text/javascript">
 document.title='Hello &#8212; World';
</script>

Open in new window

Avatar of leakim971
leakim971
Flag of Guadeloupe image

Which browser version?
Work for me : http://fiddle.jshell.net/kHnPa/show/
document.title = "Hello - World"

Open in new window

Avatar of hankknight

ASKER

Thanks, but my question is about how to get a numbered entity into the title.

"—" is NOT the same a "-", it is much wider.  I want to define it with the entity number, &#8212;
SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial