I am currently working on an android WebView project where I have managed to change the background color to orange with this code snippet.
@Override
public void onPageFinished(WebView view, String url) {
wv.loadUrl("javascript:(function() { " +
document.body.style.background = 'orange';
"})()");
}
Whenever the desired page is loaded, the background successfully changes to orange.
However, my attempt to hide a button on the same page using the following code does not seem to work:
@Override
public void onPageFinished(WebView view, String url) {
wv.loadUrl("javascript:(function() { " +
"var input = document.getElementById('submit');" +
"input.style.display= 'none';" +
"})()");
}
The button remains visible despite the code above. Any advice on what mistake I might be making?