In Android, how can I set the value of a edit box in WebView using Javascript

后端 未结 4 1480
醉酒成梦
醉酒成梦 2021-02-09 14:27

I understand how to set the value of a edit box in WebView, and in a browser on PC with Javascript.

It is basically first find out the ID of the edit box (text), then s

4条回答
  •  有刺的猬
    2021-02-09 15:16

    This worked perfectly for me:

    String ABC="50";
    
    myWebView.loadUrl("javascript: (function(){document.getElementById('countLiveSteps').value ='" + ABC + "';})();");
    

提交回复
热议问题