Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7192659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:59:13+00:00 2026-05-28T19:59:13+00:00

I have a problem with dijit editor of dojo: I used execCommand to insert

  • 0

I have a problem with dijit editor of dojo:

I used execCommand to insert html content at the cursor in editor like :

var ed = dijit.byId('myEditor');
var myDiv = "<div id='myDiv'> This is content of div </div>"
ed.focus();
ed.execCommand("inserthtml", myDiv);

myDiv is inserted successfully into the editor, but when I type other content in the editor, that content is within myDiv. So could you tell me how can I move the selection to be after that div ?

Thank you for help !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T19:59:14+00:00Added an answer on May 28, 2026 at 7:59 pm

    If you mean you want to place cursor after your inserted div , then try:

    
    var ed = dijit.byId('myEditor');
    var myDiv = " This is content of div "
    ed.focus();
    ed.execCommand("inserthtml", myDiv);
    ed.execCommand("inserthtml", "<br />"); //add a break tag after your new div
    ed.placeCursorAtEnd(); // places cursor at the end
    
    

    Did you mean something like this

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have problem with dijit.Editor. After removing it's DOM from document and re-appending it,
I have the following code: dijit.byId('patient').onchange(function(event){ var term=dijit.byId('patient').get('value'); patientList.url = .calendar/search-patient?term=+term; patientList.close(); }) What
I have a problem with the Dojo Dijit Dialog .hide() method during the animation
I have problem while loading data into html select when users press or click
I have the following HTML and CSS: <button id=myBtn dojoType=dijit.form.Button>Testing</button> #myBtn { margin-left: 100px;
I have a form containing many dijit.form elements and also a dijit.Editor. The form
I have this problem I'm using DataGrid + dojo.store.JsonRest as store. I want to
I have problem in DOJO with DataGrid. I refresh my grid on every 1
I have a problem... I tried to remove the selected items from dijit.form.MultiSelect when
So here's the problem. We have some big dojo forms created using Zend_Dojo_Form. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.