Questions tagged [contenteditable]

contentEditable is an HTML attribute (invented by Microsoft and standardized in HTML5) that is used for client-side in-browser "rich text" editing.

There are really two attributes involved, designMode and contentEditable. The designMode attribute governs the entire document (i.e. it makes the entire document editable, like a dedicated HTML editor). The contentEditable attribute governs just the element on which it appears, and that element's children -- like a rich text editor control within a page.

Resources

2552 questions
1
vote
3 answers

Cursor (caret ) moves to beginning when call on change event on contenteditable div using angular js

The cursor gets moved to the beginning instead of being set to last type position when the change event is fired. I am using content editable div using angular js. plunker http://plnkr.co/edit/FFaWNZmgk00Etubtjgg8?p=preview Why does the cursor…
1
vote
2 answers

Detect when contenteditable div has multiple lines of text

I am using a contenteditable on my page. When the user focuses the div, the height is set in js. (Needed to show buttons irreverent to the this issue) If the user types a significant amount of text, as to push multiple lines, it overflows the box…
Mooseman
  • 18,763
  • 14
  • 70
  • 93
1
vote
0 answers

Dynamic table-width doesn't adjust properly

I'm trying to build a genealogy tree with HTML tables (and nested tables). It should, ultimately be editable by the user using contenteditable, and the nested cells should resize accordingly. However, to my mystery, when I edit the cells, they…
mheim
  • 366
  • 1
  • 12
1
vote
1 answer

custom styling with(out) execCommand (how to deal with overlapping tags)

Because execCommand doesn't work as expected I want to build a similar function on my own. It should be possible to apply different styles to a text. If I want to add a style it is easy as I can simply use range.surroundContents which let me put for…
user3159270
  • 119
  • 2
  • 10
1
vote
2 answers

How do you turn off auto-capitalisation in an editable div on iOS?

I'm aware that for input and textarea tags you can specify autocapitalize as off. Is there a way to do this when you are using a content editable div, as they do not have the autocapitalize attribute? I have seen similar thinks achieved elsewhere,…
Jools
  • 839
  • 8
  • 22
1
vote
1 answer

2-way data binding to contenteditable span

How to get 2-way binding to work with a span contenteditable="true" instead of an input? See Plunker
Alex McMillan
  • 17,096
  • 12
  • 55
  • 88
1
vote
0 answers

replace tag without losing caret position

Here is the jsFiddle of what I am trying to achieve. Example HTML:
Hello I am to be replaced. But the cursor position inside this div needs to be retained after…
shankardevy
  • 4,290
  • 5
  • 32
  • 49
1
vote
3 answers

How to focus multiple selected line in contenteditable div in jquery

When i try to given below code for change margin-bottom of selected multiple line, at that time only last selected line was change other line just add p tag but not the style. May be i can not focus all selected line.I tried below code for…
Akhi
  • 167
  • 1
  • 2
  • 12
1
vote
1 answer

Firefox JavaScript Range not working

I have a simple snippet of code that injects an element into a contenteditable and places the user's cursor inside it. It works well in every modern browser except Firefox. Any ideas on why this isn't working (any help appreciated)? Live demo at…
Ash Blue
  • 5,344
  • 5
  • 30
  • 36
1
vote
1 answer

drag and drop between lines or paragraphs in contenteditable

I am trying to drag and drop content in my contenteditable area.

some multiline paragraph paragraph

another multiline paragraph

DRAGGABLE
Html with the same…
shankardevy
  • 4,290
  • 5
  • 32
  • 49
1
vote
1 answer

How to get smart word breaks in html content editable DIV

So I'm working with a content editable DIV and I want to implement a smart word breaking feature like you see in most word processors, sites like Medium.com, and in the very box I'm typing this into on Stack Overflow What I mean by smart word…
Eugene
  • 1,377
  • 2
  • 18
  • 22
1
vote
1 answer

Focus a contenteditable div after double clicking on it

I have a div that is initially has contenteditable=false.
def text
I want to make it contenteditable=true and focus it after double click. function…
user2265529
  • 479
  • 1
  • 8
  • 18
1
vote
1 answer

disable drag/drop icons for focussed contenteditable in Firefox

Firefox (20.0.1) displays drag & drop icons around contenteditable elements when they are focussed. How can I disable these icons? Example below: Arrows around "THREE".
Marc Owens
  • 121
  • 2
  • 11
1
vote
1 answer

copy/duplicate live data from div to textarea using jquery

I have create a rich text editor using DIV as editor container. How can I pass the DIV value to textarea? I already use jquery code. it success when I view it live but when I submit the form, the textarea value is empty. Here is my code:- HTML
Nad
  • 83
  • 1
  • 3
  • 7
1
vote
1 answer

Limiting an editable div area by height, simulating onkeyup event in Javascript

I know there are many similar topics but none of them has the solution to my problem so please read my question carefully before sending similar topic links and marking as duplicate question. I have a content editable DIV object, something similar…
Emir Akaydın
  • 5,708
  • 1
  • 29
  • 57
1 2 3
99
100