Check execCommand createlink status

When creating a simple WYSIWYG editor with JavaScript for a text field, I can check the current status of the button (Bold, Italic, Underlined, etc.) as follows:

document.queryCommandState("bold")

But if I would like to see if there is selected text, a linked link, how can I do this (or is it a longer process?). The same query (or queryCommandValue) with "CreateLink" does not work.

+3
source share
1 answer

document.queryCommandState("CreateLink") (. ), , , DOM . DOM a, . , .

+2

Source: https://habr.com/ru/post/1716095/


All Articles