let event = new InputEvent('input'); // let event = new UIEvent('change'); 或者精准触发onchange
Array.prototype.forEach.call(document.getElementsByClassName('ivu-input ivu-input-default'), input => {
if(input.placeholder==='Permission'){
input.value = 'xx'
input.dispatchEvent(event) // 手动触发input的事件,否则不会触发valid
}
})
网友评论