Ver originaldocument.getElementById("id_del_input").onkeyup = function() { if (this.value.length == 13) // ejecutar función}