开发者

how to change actions on key pressed in contenteditable tags

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜