Phương thức sự kiện HTML
Các sự kiện HTML DOM cho phép JavaScript đăng ký các trình xử lý sự kiện khác nhau trên các thành phần trong tài liệu HTML.
Sự kiện thường được sử dụng kết hợp với các hàm và hàm sẽ không được thực thi trước khi sự kiện xảy ra (chẳng hạn như khi người dùng nhấp vào nút).
Để biết hướng dẫn về Sự kiện, hãy đọc Hướng dẫn sự kiện JavaScript của chúng tôi.
Phương thức sự kiện HTML DOM
Method | Description | Belongs To |
---|---|---|
getModifierState() | Returns true if a specified key is activated | MouseEvent |
getTargetRanges() | Returns an array containing target ranges that will be affected by the insertion/deletion | InputEvent |
preventDefault() | Cancels the event if it is cancelable, meaning that the default action that belongs to the event will not occur | Event |
stopImmediate Propagation() |
Prevents other listeners of the same event from being called | Event |
stopPropagation() | Prevents further propagation of an event during event flow | Event |