Código Javascript
:
Ver originalfunction createInput(id) {
var el = document.getElementById(id);
if(!el){
//...
//crear elemento en el dom y asignarle un id
}
return el;
}
function ab(valor) {
var el = createInput('myInput');
//...
//asignarle el valor al input
el.value = valor;
}