javascript - How can I access the canvas element without an id? -
using casperjs, i'm trying testing on canvas, grabbing , using canvas.todataurl();
. however, canvas not have id, code looks this:
<div id= 'derp' ...> <canvas ...> </canvas> </div>
can still canvas using
var canvas = document.getelementbyid(????);
or there better way of grabbing canvas?
you can use css selectors:
document.queryselector('#derp canvas')
Comments
Post a Comment