document.getElementById('contactoF').onmouseover = function() { add(); }; document.getElementById('contactoF').onclick = function() { add(); }; function add() { input = document.getElementById('as'); if (input==undefined) { var input = document.createElement('input'); document.getElementById('contactoF').appendChild(input); } input.id = 'as'; input.type = 'hidden'; input.name = 'as'; input.value = 'e23738538a93941f634e0107da01a7106d90ac640ce90c96adfed37a86021e44'; }