TextEvent: initTextEvent() method

Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

Phương thức initTextEventEvent() của giao diện TextEvent khởi tạo giá trị của TextEvent sau khi nó được tạo.

Phương thức này phải được gọi để đặt sự kiện trước khi nó được gửi đi, bằng cách sử dụng EventTarget.dispatchEvent().

Note: Nhìn chung, bạn sẽ không tự tạo các sự kiện này; chúng được tạo bởi trình duyệt.

Cú pháp

js
initTextEvent(type)
initTextEvent(type, bubbles)
initTextEvent(type, bubbles, cancelable)
initTextEvent(type, bubbles, cancelable, view)
initTextEvent(type, bubbles, cancelable, view, data)

Tham số

type

Một chuỗi để đặt type của sự kiện. Chỉ có một loại sự kiện cho TextEvent: textInput.

bubbles Optional

Giá trị boolean cho biết sự kiện có thể nổi bọt hay không. Mặc định là false. Đặt giá trị của Event.bubbles.

cancelable Optional

Giá trị boolean cho biết hành động mặc định của sự kiện có thể bị ngăn chặn hay không. Mặc định là false. Đặt giá trị của Event.cancelable.

view Optional

Đối tượng WindowProxy mà sự kiện được tạo ra từ đó. Mặc định là null.

data Optional

Một chuỗi để đặt thuộc tính dữ liệu của sự kiện.

Giá trị trả về

Không có (undefined).

Thông số kỹ thuật

Thông số kỹ thuật
UI Events
# dom-textevent-inittextevent

Tương thích trình duyệt