Rusty Well-Known Member Licensed User Longtime User Jul 23, 2020 #1 I have an HTML document that contains this java script: B4X: Copy <script> function myFunction() { var elmnt = document.getElementById("Q1"); elmnt.scrollIntoView(); } </script> If I put an input of type button within the HTML, and click it, it works fine and scrolls to the item with ID="Q1" I would like to be able to, from within my B4a code execute the myFunction while I: pass a parameter into the myFunction like myFunction("Q1") and programmatically "click" or execute the java script function from B4a code Is this possible? If so, how might I go about this? If this is not possible, is there a way from within B4a code to scroll to an ID within the Webview HTML? Thanks Rusty
I have an HTML document that contains this java script: B4X: Copy <script> function myFunction() { var elmnt = document.getElementById("Q1"); elmnt.scrollIntoView(); } </script> If I put an input of type button within the HTML, and click it, it works fine and scrolls to the item with ID="Q1" I would like to be able to, from within my B4a code execute the myFunction while I: pass a parameter into the myFunction like myFunction("Q1") and programmatically "click" or execute the java script function from B4a code Is this possible? If so, how might I go about this? If this is not possible, is there a way from within B4a code to scroll to an ID within the Webview HTML? Thanks Rusty
JohnC Expert Licensed User Longtime User Jul 23, 2020 #2 Use WebViewExtras: B4X: Copy wve.executeJavascript(wv, "myFunction('Q1')") Upvote 0