简体   繁体   中英

Disable spellcheck on textarea when input is pasted

How do you disable spellcheck on a textarea if the user pastes their input? Spellcheck="false" only works if the user manually keys their input.

这是一个黑客,但要让它在Chrome中工作,你可以这样做:

<textarea spellcheck='false' onpaste="this.value=event.clipboardData.getData('text/plain');return false;"></textarea>

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