对于支持HTML5浏览器有2种方法:
1. HTML5
<div contenteditable="plaintext-only"></div>
2. CSS3
user-modify: read-write-plaintext-only; -webkit-user-modify: read-write-plaintext-only
非HTML5浏览器,参考以下JS
总结参考:http://www.cnblogs.com/sheshou/p/5416885.html
.