You may get the text, split it by spaces, and take the first element.
For example:
$( document ).ready(function() {
var fullName = $(".label-name").first().text(); //This will get the text from the first element with the class label-name
var nameArray = fullName.split(" "); //Split the text by spaces into an array
var firstName = nameArray[0]; //Take the first element of the array
$(".label-name").first().text(firstName); //Set the text of the first element with the class label-name to the first name
});
EDIT: As I noted in the comments, this will get the first element with the class label-name. If there are multiple elements with this class you may need a different selector. The jQuery selectors are documented at http://api.jquery.com/category/selectors/. If you post the full HTML source and let me know which element you want I will offer further advice.
EDIT 2: If you need to select and replace in multiple elements with the same class, you can drop the .first()
selector from the code and use a loop to edit the results. For example:
$( document ).ready(function() {
var fullNameObjects = $(".label-name");
$.each(fullNameObjects, function () {
var nameArray = this.split(" ");
var firstName = nameArray[0];
this.text(firstName);
});
});