Getting an entire HTML code of an element using element’s ID and outerHTML property

I needed a way to send an email to my site’s visitors with info already generated on screen.  In my case it was a dynamically generated table of data.  The simplest solution for me was to grab the entire table’s html code and using ajax to post it to a PHP script which will send out the email.

I used the following code for getting the html code for a table element with id=”resultsTable” :

 

Leave a Reply

Your email address will not be published. Required fields are marked *