EN
이 콘텐츠는 한국어로 제공되지 않아 영어 버전으로 표시됩니다.

preventDefault method

Cancels the default action of an event.

Document Object Model (DOM) Level 3 Events Specification, Section 4.1Internet Explorer 9

 

Syntax

object.preventDefault()

Parameters

This method has no parameters.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Standards information

Remarks

If an event is cancelable, the preventDefault method signfies that the event should be canceled. Any event handler can cancel the default action. If the event cannot be canceled, this method has no effect.

A call to this method is similar to setting the returnValue event property to false in Windows Internet Explorer 8 and earlier versions.

See also

BeforeUnloadEvent
CompositionEvent
CustomEvent
DragEvent
Event
FocusEvent
KeyboardEvent
MessageEvent
MouseEvent
MouseWheelEvent
MSSiteModeEvent
MutationEvent
StorageEvent
SVGZoomEvent
TextEvent
UIEvent
Reference
cancelable
stopPropagation

 

 

표시:
© 2014 Microsoft