function submitLink(link) { var form = document.createElement("form"); form.setAttribute('method', 'POST'); form.setAttribute('action', 'gateway.htm'); input = document.createElement("input"); input.setAttribute('type', 'hidden'); input.setAttribute('name', 'link'); input.setAttribute('value', link.href); form.appendChild(input); document.body.appendChild(form); form.submit(); }