i know how to execute execCommand on some selected text, but is there a way to execute on some other text in my contenteditable div ?
i know how to execute execCommand on some selected text, but is there a
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In IE, yes. In other browsers, no.
All major desktop browsers implement some form of
document.execCommand(), which acts only on the user selection. In IE, theTextRangeobject also has anexecCommandmethod. For example, the following will turn the text contents of an element green when the user hovers the cursor over it: