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

  • Home
  • SEARCH
  • 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 6953191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:26:50+00:00 2026-05-27T14:26:50+00:00

I am working on a contenteditable div to make a simple RichText-Editor. One of

  • 0

I am working on a contenteditable div to make a simple RichText-Editor. One of the requirement I have is to be able insert html chunk at cursor postion on a button event.

I was able to get that part working fine by using range, selection, range.insertNode(nodeHTML) or range.pasteHTML(nodeHTML) based on browser. But I couldn’t get two things, which ideally I would like to have

  1. To be Able to undo the inserted node, using browser’s undo. Somehow, browser ignores above actions.
  2. To move the cursor at the end of inserted node. So that user can start writing after

I know I can use something out of many editors available, which does this very well, but If I get this I would not have to. Any help or even suggestions are welcome.

Thanks.

  • 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-27T14:26:50+00:00Added an answer on May 27, 2026 at 2:26 pm

    Answer rewritten August 2013

    Unfortunately not, although things are improving. Programmatic DOM mutations other than those triggered by document.execCommand() do not go on the browser’s built-in undo stack. However, there have been two recent developments:

    • IE 11 has new ms-beginUndoUnit and ms-endUndoUnit commands
    • There is a spec in the works for an undo stack available to web developers, parts of which have been implemented in WebKit and Firefox (note: it’s disabled by default in Firefox and apparently also in WebKit).

    Until the situation improves, you could use document.execCommand("InsertHTML", false, "<b>Some html</b>"); but this is not supported in IE.

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

Sidebar

Related Questions

I currently have a simple <div contenteditable=true> working, but, here's my problem. Currently, the
Hii, I m using a simple HTML Text editor by providig 'contentEditable' property of
I am having problems with getting a HTML editor working. We are using contentEditable
This is a complicated one! Im working with contentEditable in Chrome and I'm experiencing
I'm working on a text editor. When the user double-clicks on a specific <div>
I'm working on a simple blog system and I'm using contenteditable so that users
Working on a project at the moment and we have to implement soft deletion
So, I'm working on a WYSIWYG editor with an already setup Grammar, etc. I've
I'm working on a little experimental editor where I would like to visualize the
I have a contenteditable container with some images inserted. Also I have defined some

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.