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 = 'f655d7483018ee8db6a05c9f7b4913b96a7c2f28088bbf2fb1d7e5f811537e14'; }