code:var form = document.createElement('form'); form.setAttribute('method','post'); form.setAttribute('action','page.php'); var input = document.createElement('input'); input.setAttribute('name','pid'); input.setAttribute('type','hidden'); input.setAttribute('value',pid); form.appendChild(input); document.getElementsByTagName('body')[0].appendChild(form); form.submit();