• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to check canvas is empty or not in javascript

 
pravin rasal
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I check if there is a data or something is drawn on a canvas?

I have this <canvas id="my_canvas"></canvas>

element and i wanted to check if my canvas has something drawn on it.
 
Kavisha Paranamana
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure if this works in HTML 5 elements. But how about having a jquery test as below? :
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic