I have a template code like this:
<img id ="canvas" src="../images/carsimage.jpg" />
I am trying to pass this element to a function by making something like getElementById in javascript. But I am getting an error with 'this.$.canvas'
initDraw(this.$.canvas);
initDraw(canvas) {
}
You should define a better question and provide a codepen/fiddle/whatever, but assuming you want to call it from a component, you forgot to call the initDraw function using
this. In Polymer v2 would be something like this: