开发者

how to change actions on key pressed in contenteditable tags

开发者 https://www.devze.com 2022-12-29 17:44 出处:网络
when I press \'enter\' in contenteditable area a new <div> is produced what I rather want to add <br /> tag. How can I manipulate this behaviour. How is it done in WYMed开发者_开发百科itor

when I press 'enter' in contenteditable area a new <div> is produced what I rather want to add <br /> tag. How can I manipulate this behaviour. How is it done in WYMed开发者_开发百科itor. Is there any other method than preventdefault() and handle it ?


No. That's the way it's done. In IE, you need to set the event's returnValue property to false rather than call preventDefault() (note the capital D in the middle).

0

精彩评论

暂无评论...
验证码 换一张
取 消