var xhr = new XMLHttpRequest(); xhr.open('POST', 'path/to/your/script.php', true); xhr.send(document.getElementById('your-div').innerHTML);