How to show username on top of page

CSS

Login user’s name can be shown on the top of the page by the following codes where “var username” is a global variable that is valid across the pages.

HTML:

<div id="row">
      <p id="customer"></p>
</div>

Java Script:

var username;
document.getElementById("customer").innerHTML =
      username + "'s page";