javascript - How to remove multiple divs from a webview by class and id? -


i trying remove multiple divs class , id webview.

how can this?

this have tried:

 webview.loadurl("javascript:(function() { " +                         "document.getelementsbyclassname('header-top')[0].style.display='none'; " +                         "document.getelementsbyclassname('inchoo-socialconnect-login')[0].style.display='none';" +                         "document.getelementbyid('before-footer')[0].style.display='none';" + "document.getelementbyid('footer')[0].style.display='none';" + "})()"); 

in code above remove first element found. method getelementsbytagname returns array, loop through elements rather [0] element things done.

also recommend call javascript function in webpage rather printing entire function in webview.loadurl


Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -