Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 138221

Change property of class in wkwebview

$
0
0

I'm using WKWebview in my IOS Application.

I'm using:

bookingView.evaluateJavaScript("document.getElementById('nearbyLink').style = 'display:none';") { (response, err) in
            if let err = err{
                print(err.localizedDescription)
            }
        }

to remove a specific element by it's ID (This works fine!), but somehow this does not work on all elements.

I'm trying to remove another element by its class name using document.getElementsByClassName() but it's still not being removed.

I've tried to remove the elements using this how to hide html elements in wkwebview in IOS? but still doesn't work.

Is there any other way I can remove objects in WKWebview?

So let's say I wanna remove a link like:

<form class="sort-options">

How can I change the code and add like this:

<form class="sort-options" style="display:none">

The webpage is not owned by me!


Viewing all articles
Browse latest Browse all 138221

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>