I want to set content on Page Load inside HtmlEditorExtender
<asp:TextBox runat="server" ID="txt_plbNtCom" Height="300px" Width="99.8%" TextMode="MultiLine"></asp:TextBox>
<asp:HtmlEditorExtender TargetControlID="txt_plbNtCom" ID="ed_plbntcom" runat="server"></asp:HtmlEditorExtender>
JQUERY
var htmlEditorExtender = $('.ajax__html_editor_extender_texteditor');
console.log(htmlEditorExtender);
htmlEditorExtender._editableDiv.innerHTML = "something";
I am getting null in Console.
Try using getElementById()
to first, catch the control that you want to edit and then try setting the innerHTML
for that. Something like this should get you through :
<script type="text/javascript">
var x = document.getElementById("yourControlId");
x.innerHTML = "somethingSomething";
</script>
Also, make sure your control is loaded before you call this or you can use $( document ).ready()
wrapper on this.
Hope this helps.
Look here, it may be useful: https://taditdash.wordpress.com/2014/03/05/set-content-inside-ajax-htmleditor-and-editorextender-using-javascript/
var htmlEditorExtender = $('.ajax__html_editor_extender_texteditor');
htmlEditorExtender.html("something");
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.