You can use charAt to get the first letter.
var x = 'some text'; alert(x.charAt(0));
If you use jQuery and have a text field with id = "firstName", you can access the first letter as follows.
var firstLetter = $("#firstName").val().charAt(0);
source share