我需要使用JavaScript/jQuery在iframe(带有id和名称)中单击按钮(不带id和名称)。如何在iframe中点击没有ID或名称的按钮?
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js" type="text/javascript">
</script>
</head>
<body>
<iframe name="abb" id="abb" src="http://example.com" scrolling="no"frameborder="0" style="border:none; overflow:hidden; width:45px; left:-19px; height:21px; z-index: 0; position: relative;" allowTransparency="true"></iframe>
</div>
<script>
document.getElementById("abb").contentWindow.document.getElementsByName('REG_BTN')[0].click();
</script>
</body>
</html>
我已更新帖子。 – user3270842
[拦截点击iframe中的内容]的可能重复(http://stackoverflow.com/questions/2085752/intercept-click-on-content-in-an-iframe) –