Get Username using JavaScript on Form

I am Trying to get first and last name on a form of the user logged in but im unable to do it I can only get user ID using the following JS code

Please help

<!DOCTYPE html>


<p id="test"></p>

var myInnovator = new top.Innovator();

var userID = myInnovator.getUserID();

document.getElementById("test").innerHTML = userID ;