1.

What Is Preventdefault () Method?

Answer»

To cancel the default behaviour of the event. The methods of the Event CLASS can be used in event listener functions to affect the behaviour of the event OBJECT. Some events have an associated default behaviour. For example, the doubleClick event has an associated default behaviour that highlights the word under the mouse POINTER at the TIME of the event. Your event listener can cancel this behaviour by calling the preventDefault () method.

PreventDefault () method will work only if Cancellable PROPERTY is true, otherwise it’s not working.

To cancel the default behaviour of the event. The methods of the Event class can be used in event listener functions to affect the behaviour of the event object. Some events have an associated default behaviour. For example, the doubleClick event has an associated default behaviour that highlights the word under the mouse pointer at the time of the event. Your event listener can cancel this behaviour by calling the preventDefault () method.

PreventDefault () method will work only if Cancellable property is true, otherwise it’s not working.



Discussion

No Comment Found