0
The split
returns an array, just take the second position of the array as below:
var resultado = $('#idPeriodoInicio').val().split("/");
alert("o valor do split " + resultado[1]);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<input id="idPeriodoInicio" value="04/2026" />
You want only 2026 to appear?
– André Lins
I don’t understand exactly what you want, need to appear only the year or 4/2026?
– Daniel Obara
@That’s right, I just wanted you to show up 2026
– wladyband
Hmm got it. you could use something like this if it was already in date: var dt = new Date(); Document.write("getYear() : " + dt.getFullYear()); But we need to first know how to turn date by passing parameter to date() from the field data to then use getFullYear()
– Daniel Obara