0
我已經使用[_webView [email protected]"document.getElementById('ELEMENTNAME').value = 'NAME OF VALUE I WANT'"];
如何在不使用.selectedIndex =的情況下自動選擇UIWebView中的下拉選擇器視圖?
但是這不起作用。先謝謝你!
我已經使用[_webView [email protected]"document.getElementById('ELEMENTNAME').value = 'NAME OF VALUE I WANT'"];
如何在不使用.selectedIndex =的情況下自動選擇UIWebView中的下拉選擇器視圖?
但是這不起作用。先謝謝你!
您應該改用selectedIndex屬性。
舉例來說,如果你要選擇第三選項,使用
document.getElementById('ELEMENTNAME').selectedIndex = 2 //Index of the option.
第六屆選項,使用
document.getElementById('ELEMENTNAME').selectedIndex = 5 //Index of the option.
謝謝,我已經完成了這個工作,並且它可以工作,但是我需要它根據選項的名稱而不是順序來選擇選項。謝謝 – user3155477
請寫在問題的整個問題,不要使用作爲問題的一部分。 – RobG
對不起。 – user3155477