Skip to content

Instantly share code, notes, and snippets.

@rincewind
Created April 2, 2009 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rincewind/89434 to your computer and use it in GitHub Desktop.
Save rincewind/89434 to your computer and use it in GitHub Desktop.
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html> <head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>innerHTML demo</title>
</head>
<body>
<h1 id="withnbsp">This has an en&nbsp;be&nbsp;es&nbsp;p</h1>
<h2 id="withoutnbsp">This does not use en be es pe (uses the \xa0 character)</h2>
<h3 id="otherchars">
Umlauts: üäößÜÄÖ, an endash: –, a numeric entity 160 (nbsp):
&#160;, "in quotes", less than as a numeric entity: &#60;
</h3>
<script type="text/javascript">
alert(document.getElementById("withnbsp").innerHTML);
alert(document.getElementById("withoutnbsp").innerHTML);
alert(document.getElementById("otherchars").innerHTML);
</script>
<hr>
<address></address>
<!-- hhmts start --> Last modified: Thu Apr 2 23:31:10 CEST 2009 <!-- hhmts end -->
</body> </html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment