Is it possible to remove a html div in objective-C/xCode? So for example the html looks like this :
<html>
<div id="menu"> the menu code </div>
<p> lorem ipsum text </p>
</html>
So if I could remove this menu only the text content would be displayed. That is what I want to make.
You can use javascript to hide it in the webView delegate method:
- (void)webViewDidFinishLoad:(UIWebView *)webView {
NSString* script = [NSString stringWithFormat:@"document.getElementById(\"menu\").style.display='none';"];
[self.webView stringByEvaluatingJavaScriptFromString:script];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With