문제

I am making a WYSIWYG editor using execCommand() and my own drag-and-drop javascript functions.

I want to be able to find the name and size of the selected text if applicable. How can I do this exactly?

Are there specific functions relating to execCommand() to do this?

도움이 되었습니까?

해결책

alert(iFrame.document.queryCommandValue("FontSize"));

OR

alert(iFrame.document.queryCommandValue("ForeColor"));

You can't do it with execCommand, as execCommand only returns true or false based on whether or not it succeeded. However, there are some problems with this apparently. I suggest reading up on

ContentEditable - Get current font color/size

Fore more information

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top