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