A
A
Arthur Koch2012-04-25 11:25:56
JavaScript
Arthur Koch, 2012-04-25 11:25:56

How to remove a specific anchor in tinyMCE?

It is necessary to remove a specific anchor (has a unique id and name) in the editor.

The default editor button (unlink) removes the link in the selected text fragment.
If we refer to the function tinyMCE.execCommand('unlink',false,null); then it will remove all links in the paragraph where the cursor is currently located.

I need to click on an element (has a unique id) outside the editor to remove the corresponding anchor in the editor.

I thought in the direction of find & replace, but this does not work with the source code of the text in the editor, but only with the text itself.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arthur Koch, 2012-04-26
@dudeonthehorse

I asked myself, I will answer.
document.getElementById('text_ifr').contentWindow.document.body.innerHTML and remove the link

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question