JSFiddle - React, Tailwind, and code Playground

HTML

<form name="userinfo"  id="userinfo">
	<input name="famName">
	<input name="address">
	<input name="firstName">
</form>

JavaScript

function systemUsername()
	 {
	 /*consists of the first
	 alphabetic characters found in the Family name, street address, Given name; the numerical day of the
	 month; and the numerical seconds field of the time of submission. E.g.: A user registers with name
	 Bernardo O’Higgins, address 213 Liberator St, at 12:31:16 on 25 April 2014. His system username is
	 OLB2516*/

	 var systemUsername = document.createElement("systemUsername");
	 var lastname = document.forms["userinfo"]["famName"].value;
	 var Address = document.forms["userinfo"]["address"].value;
	 //var withNoDigits = address.replace(/[0-9]/g, '');
	 var firstname = document.forms["userinfo"]["firstName"].value;
	 var dateStamp = new Date();
	 var dayNum = dateStamp.getDate();
	 var Seconds = dateStamp.getSeconds();

	 if (dayNum<10)
	 {
	     var x = '0';
	     dayNum = x + dayNum;
	 }
	     alert(dayNum);

	 if (Seconds<10)
	 {
	     var x = '0';
	     Seconds = x + Seconds;
	 }
	     alert(Seconds);

//	 var tempSU = lastname.charAt(0)+Address.charAt(0)+firstname.charAt(0)+dayNum.charAt(0)+dayNum.charAt(1)+Seconds.charAt(0)+Seconds.charAt(1);
	 var tempSU = lastname.charAt(0)+Address.charAt(0);
	  systemUsername.setAttribute("type", "hidden");
	 systemUsername.setAttribute("name", "systemName");
	 systemUsername.setAttribute("value", "tempSU");
	 document.getElementById("userinfo").appendChild(systemUsername);
	 alert("tempSU: "+tempSU);
	 }


systemUsername();