在某些情况下,javascript.click()方法在android上不起作用

在某些情况下,javascript.click()方法在android上不起作用,javascript,android,eclipse,web,webview,Javascript,Android,Eclipse,Web,Webview,链接的HTML代码: <a href="#" id="10" target="_blank"> some codes here... </a> 但是没有结果 我之前已经为我的webView启用了javascript,它可以正常工作。。。 我还对其他网页上的其他元素测试了.click()方法,它工作正常 我应该怎么做才能让webView点击链接?请帮帮我;谢谢大家! 我想身份证和名字必须以字母开头。尝试将id=“10”更改为id=“i-10”,并在javas

链接的HTML代码:

<a href="#" id="10" target="_blank">
    some codes here...
</a>
但是没有结果

我之前已经为我的webView启用了javascript,它可以正常工作。。。 我还对其他网页上的其他元素测试了.click()方法,它工作正常

我应该怎么做才能让webView点击链接?请帮帮我;谢谢大家!





我想身份证和名字必须以字母开头。尝试将id=“10”更改为id=“i-10”,并在javascript调用中进行更改。

谢谢,但是没有其他方法吗?例如,因为可以在windows上的google chrome控制台上使用这些元素…同样,在html5中,您可以使用
数据-
内部元素来引用某些元素。您能帮我更多吗?我如何在android上使用它在webview中单击此元素?尝试在javascript中创建函数
doClick()
,它需要做什么,使id以字母开头,并调用view.loadUrl(“javascript:doClick()”)?谢谢,但我不能更改他们的id。。。还有其他意见吗(
webView.loadUrl("javascript:(function(){document.getElementById('10').click();})()");
EDIT :

Perhaps it's because of the numeric start of id name of these elements,
    but I can use them using their id or tag name on
    google chrome console on windows without any problem...

but It's not possible to use them using their tag name, even, to click on, on android webView !
EDIT 2 :

The problem isn't numeric start of 'id's in fact !
I've found out that click function doesn't work even for other ids without numerics
    IN THIS PAGE I'M USING ONLY...
        AND THIS IS WHAT I CAN'T UNDERSTAND WHY !!!
I've tried creating fireEvent function, too... FAIL AGAIN !


I SHOULD ADD THAT THE HTML CODE OF THE PAGE IS SOMETHING LIKE THIS IN FACT :

    <div class="abc"><a href="#" id="defg"></a></div>
EDIT 3 : Sorry I forgot to say that these elements should open a window in the page
    when they are called by click.

I found out that when I click them using javascript on android,
    the html source of the page changes ( so the Click is being called as we need )
    , but the window doesn't open and it's data are not received...
EDIT 4 : I have used these codes after defining my webView, so what's the problem exactly ???

    WebSettings webSettings = webView.getSettings();
    webSettings.setJavaScriptEnabled(true);
    webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
    webView.setWebViewClient(client);
    webView.setWebChromeClient(new WebChromeClient());
    webView.addJavascriptInterface(iface, "droid");