0 Comments

 

If you want to clear all canvases found in a given div with jQuery, you can use the following code:

    // Clear all canvases found in the given div, including all child canvases and sub child canvases.
    $('#DivToFind canvas').each(function(idx, item) {
        var context = item.getContext("2d");
        context.clearRect(0, 0, item.width, item.height);
        context.beginPath();        
    });

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Related Posts