title: Inject Javascript into Webview - Swift
body: <p>How can I inject javascript into a webview (IOS/Swift) after loading some custom html.</p>
  
  <pre><code>@IBOutlet weak var webView: UIWebView!
  
  var html = "&lt;div id='test'&gt;&lt;/div&gt;"
  
  self.webview.loadHTMLString(html, baseURL: nil)
  </code></pre>
  
  <p>I want to inject the following javascript into the webview after I load my custom html.</p>
  
  <pre><code>var myelement = document.getElementById("test");
  myelement.innerHTML= "New Text";
  </code></pre>