Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is the code, and you can't put button inside contents it must be outside of editor contents :</p> <pre><code>&lt;body&gt; &lt;script type="text/javascript"&gt; function replaceImage() { var editor = $find("&lt;%= reFormEditor.ClientID %&gt;"); var oDocument = editor.get_document() var img = oDocument.getElementById('imageInContents'); img.src = '/image2.png'; } &lt;/script&gt; &lt;form id="form1" runat="server"&gt; &lt;asp:ScriptManager ID="mika" runat="server"&gt;&lt;/asp:ScriptManager&gt; &lt;telerik:RadEditor runat="server" ID="reFormEditor"&gt; &lt;Content&gt; &lt;img id="imageInContents" src="/image1.png" /&gt; &lt;/Content&gt; &lt;/telerik:RadEditor&gt; &lt;input type="button" onclick="replaceImage()" value="Replace Image" /&gt; &lt;/form&gt; &lt;/body&gt; </code></pre> <p>And here is an example with text change</p> <pre><code>&lt;body&gt; &lt;script type="text/javascript"&gt; function replaceSpanText() { var editor = $find("&lt;%= reFormEditor.ClientID %&gt;"); var oDocument = editor.get_document() var spn = oDocument.getElementById('span1'); spn.innerHTML = 'Text 2'; } &lt;/script&gt; &lt;form id="form1" runat="server"&gt; &lt;asp:ScriptManager ID="mika" runat="server"&gt;&lt;/asp:ScriptManager&gt; &lt;telerik:RadEditor runat="server" ID="reFormEditor"&gt; &lt;Content&gt; &lt;span id="span1"&gt;Text 1&lt;/span&gt; &lt;/Content&gt; &lt;/telerik:RadEditor&gt; &lt;input type="button" onclick="replaceSpanText()" value="Replace text" /&gt; &lt;/form&gt; &lt;/body&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload