I need to get the generated name inside the id="getname" and put it inside the id="name", I made the code below, but it did not work.
The span tag="getname" generates the client's name, in the case of Fulano da Silva and then with the script it would return only the first name.
<span data-customer="name" id="pegarnome" ></span>
<span id="nome"></span>
<script>
var str = document.getElementById("pegarnome").innerHTML;
var res = str.split(" ",1);
document.getElementById("nome").innerHTML = res;
</script>