0

I'm using contenteditable = true and document.execCommand to style the text that the user typed.

The user styles a text block with fill color, italic and bold fonts etc. And just like we do in MS Word, he needs a Copy Format button to copy all styling in a text block, and just go on some other text block, highlight and paste the same styling.

As I understand, there is no function in document.execCommand that I can use. Do you know any idea about how to do this?

a stone arachnid
  • 1,272
  • 1
  • 15
  • 27
Enis D.
  • 121
  • 11
  • Please see this [`post`](https://stackoverflow.com/questions/23934656/javascript-copy-rich-text-contents-to-clipboard). From there you can get this [`fiddle`](http://jsfiddle.net/jdhenckel/km7prgv4/3) :) – C.RaysOfTheSun Oct 05 '18 at 13:16
  • Thansk but I'm not talknig about copying a text with styles, I only want to copy "the styles", and apply the same styles to many text pieces on the page. @C.RaysOfTheSun – Enis D. Oct 06 '18 at 17:01

0 Answers0