What is meant by 'e' argument in the clearText function?

56 Views Asked by At

I am trying to implement the following code in order to remove the text from the canvas. Although it is perfectly working. But my question is that it implements when i click on the text. I want that it should implement when i press the delete key or a delete html button. That is why i am trying to understand that what is 'e' in the clearText function. Below is the reference code which is currently i am considering to remove my text from canvas.

function clearText(e) {
if (e.target.type === "i-text") {
if (e.target.text === textarea) {
e.target.text = "";
canvas.renderAll();
};
}
}
1

There are 1 best solutions below

0
On BEST ANSWER

The "e" refers to the event object which is used to work with event-related functionalities. Below link will provide you more information about that. "Target" is a property of that event object.

https://www.w3schools.com/jsref/dom_obj_event.asp