13

Safari HTML Reference: Supported Attributes says:

contenteditable

If true, the element can be edited on the fly; if false, it cannot.

Availability

Available in Safari 1.2 and later. Available in iPhone OS 1.0 and later.

However, on my iPhone, I can't get it to work. Anyone have success with this?

You can try it with this document (admittedly not pure html, but that document works in desktop Safari, and Chrome and Firefox 3). I haven't been able to get even the simplest html document to be editable in mobile Safari.

7
  • I don't think you'll get an answer for this since it would require insight from someone at apple. You could also file a bug: bugreport.apple.com Maybe you could rephrase the question to what you need to accomplish so we could come up with alternatives? Commented Nov 4, 2009 at 18:41
  • I wondered why Google Spreadsheet editing on iPhone OS was the way it is. Now it makes sense: click the Edit link, little boxes open up for each cell on the row, fill in the numbers, click "submit," click "refresh." It's doing a little <FORM>. Commented Apr 19, 2010 at 22:04
  • i don't have os4 beta 2 on my iphone but on the os4 beta 2 emulator it's still business as usual (doesn't work)... please post a video.. i'd kill to see this working because it's the only thing stopping me from claiming iphone/ipad compatibility for my web app.
    – morgan
    Commented May 4, 2010 at 3:38
  • contenteditable absolutely does not work on the iphone or ipad.. still.
    – morgan
    Commented Oct 30, 2010 at 1:06
  • contenteditable still does not work on ios 4.1 or 4.2 gold master.
    – morgan
    Commented Nov 9, 2010 at 14:34

6 Answers 6

8

contenteditable has been added to iOS 5 beta 2, according to one of the developer videos from WWDC 2011. I suggest signing up to Apple's Safari developer program and downloading that video from the WWDC videos page.

If you sign up to be a Safari dev, you also gain the privilege to submit your Website to their online iOS Web app gallery.

Edit: I've confirmed this works on my iPad running iOS 5.0.1. Try it out here: http://www.quirksmode.org/dom/execCommand/

3
  • Thanks for this; I'll accept this as the answer as soon as someone playing with the beta can confirm it is real. Commented Sep 13, 2011 at 10:15
  • It must be real as CKEditor has added support for iOS5: ckeditor.com/blog/CKEditor_3.6.2_released
    – AlfonsoML
    Commented Sep 17, 2011 at 22:10
  • yes, iOS5 does support contenteditable. anything lower, does not.
    – odle
    Commented Feb 2, 2012 at 15:07
2

It works, kind of. I thought contenteditable doesn't work on iPhone before. When I set a div to contenteditable I couldn't move the cursor/pointer to where I wanted to move it. But, when I was fiddling around XHTML with contentEditable within iBooks.app on iPad, I found that "execCommand('insertText', null, 'foobar');" worked within Mobile Safari.

1

If you wanted to, you could make a virtual keyboard using clever css and javascript, and make it into a bookmarklet.

1

If you cannot focus the contenteditable element try adding this to your css

[contenteditable] {
    -webkit-user-select: text;
    user-select: text;
}
0

The design mode and content editable are working fine in IOS 5.But in previous versions it is not working.There is post

http://mobile.tutsplus.com/tutorials/mobile-web-apps/safari-5_html5/

-3

I think this is because editing HTML requires quite an advanced user interface. That's why desktop Safari implements it, while Mobile Safari doesn't.

1
  • 9
    This is an excuse, not an answer. In desktop Safari, you don't get any fancy controls, just the ability to type into an element. Surely, iPhone can support that. Commented Sep 10, 2009 at 9:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.