title: Deselect highlighted link when webView:shouldStartLoadWithRequest:navigationType: returns false
body: <p>I'm displaying some HTML with links in a UIWebView. I want the links to open in Safari after the user confirmed that the link should really be opened.</p>
  
  <p>Opening the link works fine, but if the user cancels, the link remains selected and is highlighted in blue. How can I deselect the link and get rid of the highlighting?</p>
  
  <pre><code>- (BOOL)webView:(UIWebView *)aWebView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
   if (navigationType == UIWebViewNavigationTypeLinkClicked) {
    self.url = request.URL;
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Open the Link in Safari" message:[request.URL absoluteString] delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK"];
    [alert show];
    [alert release];
          return false;
      }
      return true;
  }
  
  - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
   if (buttonIndex == 1) {
          [[UIApplication sharedApplication] openURL:url];
   }
   // Insert magic deselection code here
  }
  </code></pre>
  
  <p><strong>Update:</strong> It seems [UIWebView stringByEvaluatingJavaScriptFromString:] is the way to go. But how exactly? I tried</p>
  
  <pre><code>for (var e in document.getElementsByTag("a")) {e.blur();}
  </code></pre>
  
  <p>but to no avail. </p>