0
嗨,我正在创建一个Chrome应用程序。我使用java脚本在按钮上创建了一个点击事件。它在简单的html页面中工作正常,但不适用于chrome应用程序。onclick不适用于Chrome应用程序?
<!DOCTYPE html>
<html>
<body>
<form>
<input type="button" id="btn01" value="OK">
</form>
<p>Click the "Disable" button to disable the "OK" button:</p>
<button onclick="disableElement()">Disable</button>
<script>
function disableElement() {
document.getElementById("btn01").disabled = true;
}
</script>
</body>
</html>
我不认为onclick事件是与移动环境兼容。 –
你是否检查过这个帖子, http://stackoverflow.com/questions/13591983/onclick-within-chrome-extension-not-working你应该添加事件监听器。 –