I have this Jquery function:
if ($("#nuevaFactura").is(':selected')) {
$("#nuevoDocumentoValorHidden").val('00001');
$("#nuevoDocumentoValor").val(idDocumento+'-'+'0001');
$("#idDocumento").val($("#nuevaFactura").val());
}
However, when the value reaches 10, the result I get is '000010', and my target is to get '0010'. And for 100, I would like '00100'. Is there a function in Jquery to get this result?