Given:
<p id="copyright">
© '
<script>
document.getElementById('copyright').appendChild(document.createTextNode(new Date().getFullYear().toString().substr(-2)))
</script>
Company Name
</p>
How does one prevent the space between the ‘ and the two digit year, i.e.,
© ‘ 24 Company Name?
2
Answers
Very simple, just remove the whitespace you put there (remember that the newline counts as whitespace here):
Indeed hacky though. Here is another approach:
Note that here, too, there must not be any whitespace between
'
and<span id="copyright-year"></span>
.There is hidden whitespace on the left of the script tag. You can fix it like this: