将文本设置为从javascript输入

将文本设置为从javascript输入,javascript,android,html,Javascript,Android,Html,我有一个简单的html页面 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width; user-scalable=0;" /> <title>My HTML</title> </head> <body> <h1>MyHTML<

我有一个简单的html页面

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width; user-scalable=0;" />
<title>My HTML</title>
</head>
<body>
<h1>MyHTML</h1>
<p id="mytext">Hello!</p>
<input type="button" id="but" value="Say hello"
    onClick="showAndroidToast('Hello Android!')" />
<input type="button" value="Open Dialog" onClick="openAndroidDialog()" />
<input type="text" class="textfield" name="email" value="" />
<script language="javascript">
    function showAndroidToast(toast) {
        AndroidFunction.showToast(toast);
    }

    function openAndroidDialog() {
        AndroidFunction.openAndroidDialog();
    }

    function callFromActivity(msg) {
        document.getElementById("mytext").innerHTML = msg;
    }
</script>
</body>
</html>

我的HTML
MyHTML
你好

函数showAndroidToast(toast){ AndroidFunction.showtoos(toast); } 函数openAndroidDialog(){ AndroidFunction.openAndroidDialog(); } 函数callFromActivity(msg){ document.getElementById(“mytext”).innerHTML=msg; }
然后我想将文本设置为输入字段“email”,并执行以下操作:
myBrowser.loadUrl(“javascript:document.getElementByName(\“email\”)。value=\“eeee\”)

但在这方面不起作用!请帮忙 我,有什么问题吗


p、 It’对不起,我的英语太差了。

您是否尝试过使用
文档。getElementsByName(\'email\”)[0]。value