直接通过 JS 修改 input 等原生 HTML 标签的值,是不会触发原生事件的,
需要再使用 JS 发出事件通知。

let inputEl = document.getElementById('input')
let customEvent = document.createEvent('UIEvents')

// 修改值
inputEl.value = 'new value'

// 发出事件通知
customEvent.initUIEvent('input', true, true, window, 1)
inputEl.dispatchEvent(customEvent)