Clear the Canvas of any Signatures

JavaScript
Transcript

English (Auto-generated)

Okay. Okay. Let's work on the function associated with the clear button here. This orange one which in html. So in index dot html you'll see has an on click attribute whose value is equal to the Clear sig function. So let's work on this function. It's a small function which will allow a user to basically if when they click on it, clear the canvas off their signature. So declare function clear sick. And then I am going to use the clear wrecked method of my um off they can't to sorry use the clear wreck method on the two D context. That's what I mean. And I will clear everything so I'll explain what I'm doing. So I'm clearing the X coordinate of the upper left corner of the canvas. Then I want to clear the y coordinate of the upper left corner of the canvas. And then I also specify that I want to clear the whole width of the canvas as well as the whole height of the canvas. So if I control s here and then let's try this out. So in my browser um refresh and you know because I'm using local storage api the data is still there. Let me clear and there you go. So let's try out our app in its entirety. So I'm going to click on blue and then I will sign something here and then let me go ahead and maybe clear this. I didn't like that. Let me save again. Once I'm done, let me save and then refresh the browser and my data is still there and let's clear. So that's all for this app. It was, I hope you liked it. It was a fun little app to do.
73 Views 0 Likes 0 Comments

Let's work on the clear button which will allow a user to clear the canvas of their signature.

Comment
Leave a comment (supports markdown format)