_r.canvas.setAttribute('id', 'myIdName');
note that if you’re using jquery, it’s also possible to access canvas: $(_r.canvas).addClass("myClassName");
$(_r.canvas).addClass("myClassName");