Cross-browser strong/em insertion using execCommand
问题 Using contentEditable feature and the execCommand , one can edit/format the content of certain parts of the page like what is used in all WYSIWYG web-editor. However, there are numerous browsers inconsistencies with the implementation of such feature, which have lead such web-editors to handle them manually. In my case, IE uses strong and em elements for the Bold and Italic commands, which is exactly what I want as I am after the semantic strong and em , and not the visual-style ones of b , i