简体   繁体   中英

How to capture input's type = 'text' clear event?

<input type='text' onchange="reportAnswer(1, this.value);" onkeyup="this.onchange();" onpaste="this.onchange();" oncut="this.onchange();" onclear = "this.onchange();" />

在此处输入图片说明

How to capture that change? This is IE11.

PS I added onclear handler because run out of ideas what to do.

You haven't said what's providing that [x] , which is probably relevant, but the one event you haven't tried yet is input so: Live Example

<input type='text'
    onchange="reportAnswer(1, this.value);"
    onkeyup="this.onchange();"
    onpaste="this.onchange();"
    oncut="this.onchange();"
    oninput="this.onchange();" />

(No idea if it works, IE11 doesn't add that box for me on Windows 8.1.)

More likely, though, you need to hook into something provided by whatever it is that's providing that [x] .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM