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