How to take screenshot of a div with JavaScript?

前端 未结 10 1539
误落风尘
误落风尘 2020-11-22 08:03

I am building something called the \"HTML Quiz\". It\'s completely ran on JavaScript and it\'s pretty cool.

At the end, a results box pops up that says \"Your Result

10条回答
  •  情歌与酒
    2020-11-22 08:32

    var shot1=imagify($('#widget')[0], (base64) => {
      $('img.screenshot').attr('src', base64);
    });
    

    Take a look at htmlshot package , then, check deeply the client side section:

    npm install htmlshot
    

提交回复
热议问题