First, make HTML input fields as follows:
< input type="text" value="" placeholder="Example" id="test"/ >
(remove the spaces in the input tag)
var whatever = document.getElementById(‘test’).value;
Edit: I made you a codepen of it. [Click here.]
Edit 2: I’m not sure how PayPal handles checkouts so I can’t help you with that. Google around and see if you can find it.