Displaying HTML value in jQuery

Displaying HTML value in jQuery

I am having issues in my code. I can't seem to display the value of the variable HTML
<html>
      <div id="target"></div>
</html>

<script>
$("viewArray").click(function(){
      var zName = $("#checkArray").val();
      var text = "<h1> Username Details </h1>";
      var uName, fName, elmail, pword, g_nder;
      var b_day = getAge();
      if(!storage[zName]){
            alert("Username doesn't exist");
            return;
      }

      uName = storage[zName].uName;
      fName = storage[zName].fName;
      elmail = storage[zName].elmail;
      pword = storage[zName].pword;
      b_day = storage[zName].b_day;
      g_nder = storage[zName].g_nder;

      text +=  "<p>Username : " + uName + "</p>
      text +=  "<p>Full Name : " + fName + "</p>";
      text +=  "<p>Email : " + elmail + "</p>";
      text +=  "<p>Password : " + pword + "</p>";
      text +=  "<p>Age : " + b_day + "</p>";
      text +=  "<p>Gender : " + g_nder + "</p>";

      $('#target').html(text);
});
</script>