Click here to Skip to main content
16,004,479 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I have a div with some contents ,How to convert this div into an image format
Posted
Updated 23-Apr-19 4:12am

Not seeing the context of what you want to do, I can give you a option that should give you what you need.

Let's assume your <div> has id='xyz'.

An image presentation could be something like:
HTML
<img src='my.gif'>
Then you can insert it into your <div> with the following:
JavaScript
<script type='text/javascript'>
  document.getElementById('xyz').innerHTML="<img src='my.gif'>";
</script>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900