title: Is there a bug with using InnerHTML inside a UIWebView within a native iPhone application?
body: <p>I have a fairly large HTML/JS/CSS application that works great when running as a web application with Safari on the iPhone.</p>
  
  <p>When running this same application in an UIWebView within a native iPhone application calls within jQuery to create HTML fragments fail silently (ie: <code>$("&lt;div&gt;HELLO WORLD&lt;/div&gt;");</code> will not create the element.</p>
  
  <p>I've tracked this down to the following equivalent code snippet in clean jQuery method:</p>
  
  <p><code>var  div = document.createElement(“div”);
  div.innerHTML = “&lt;div&gt;HELLO WORLD&lt;/div&gt;”</code>;</p>
  
  <p>When I look at <code>div.outerHTML</code> I see
  <code>&lt;div&gt;/&lt;div&gt;</code></p>
  
  <p><code>div.innerHTML</code> returns an empty string.</p>
  
  <p>This does not appear to be a  jQuery problem, nor does this happen 100% of the time.  I haven’t been able to find a pattern, but in some cases it works 2-3 times in a row, sometimes if fails 5-6 times consecutively.  This seems to only shows up when running the application inside a UIWebView in an Objective-C application.  Also I’ve only seen this on an actual device running iOS 4.2, not the emulator. </p>
  
  <p>Has anyone run into anything similar?  Does anyone have a fix?</p>