How to capture div element and upload it automatically to server as a picture with jQuery?
JavaScript cannot take screenshots, you're going to have to look at flash for something like this, and I'm not sure it's possible in that case either (for security reasons).
For example, consider this case:
<div>
<iframe src="https://somesecutesite.com"></iframe>
</div>
Should I be able to screenshot that div and upload it? It may have my information filled into form fields, etc. There are many other examples, but just security alone is a good reason this isn't allowed.
On the off-chance this is for testing If you just want to see how your site looks in various browsers, take a look at browsershots.org for your testing.
Nick is right. There would be a number of security issues relating to browser executed screenshots which are then saved to your site (think banking information).
An alternative would be doing this in a graphics library, based on the html contents of the div.
For example, if you are using PHP for your back end, you could use jQuery to fetch the contents of your 'div' element and pass it to a file via $.get(). Using GD library and knowledge of your stylesheet, and some HTML tree parsing, you supposedly could reproduce the 'div' as an image.