¡@

Home 

2014/10/16 ¤W¤È 12:04:59

jquery Programming Glossary: makeeditableandhighlight

Javascript Highlight Selected Range Button

http://stackoverflow.com/questions/1622629/javascript-highlight-selected-range-button

designMode applies a background colour and then switches designMode off again. UPDATE Fixed to work in IE 9. function makeEditableAndHighlight colour sel window.getSelection if sel.rangeCount sel.getRangeAt range sel.getRangeAt 0 document.designMode on if range sel.removeAllRanges.. colour var range sel if window.getSelection IE9 and non IE try if document.execCommand BackColor false colour makeEditableAndHighlight colour catch ex makeEditableAndHighlight colour else if document.selection document.selection.createRange IE 8 case range.. IE9 and non IE try if document.execCommand BackColor false colour makeEditableAndHighlight colour catch ex makeEditableAndHighlight colour else if document.selection document.selection.createRange IE 8 case range document.selection.createRange range.execCommand..

Change CSS of selected text using Javascript

http://stackoverflow.com/questions/3223682/change-css-of-selected-text-using-javascript

turns on designMode applies a background colour and then switches designMode off again. UPDATE Fixed in IE 9. function makeEditableAndHighlight colour var range sel window.getSelection if sel.rangeCount sel.getRangeAt range sel.getRangeAt 0 document.designMode on.. colour var range sel if window.getSelection IE9 and non IE try if document.execCommand BackColor false colour makeEditableAndHighlight colour catch ex makeEditableAndHighlight colour else if document.selection document.selection.createRange IE 8 case range.. IE9 and non IE try if document.execCommand BackColor false colour makeEditableAndHighlight colour catch ex makeEditableAndHighlight colour else if document.selection document.selection.createRange IE 8 case range document.selection.createRange range.execCommand..