我的代码有问题。我想在单击submit按钮时更改iframe url,但它不起作用。我发现了一些关于这方面的问题,我找到了GoToGoogle函数,它必须转发给谷歌。这就是我为这个页面编写的所有代码。
<script>
function sendMeToGoogle(){
document.getElementId('changeme').src="http://google.com/";
}
</script>
this is test
<iframe src="test" ID="changeme" ></iframe>
<input type="submit" onclick="sendMeToGoogle();" />
有人能帮我吗?
发布于 2012-09-05 03:46:29
您的问题是您没有调用正确的Javascript函数。你应该打电话给我
document.getElementById,但是你调用的是不存在的document.getElementId。
https://stackoverflow.com/questions/12270235
复制相似问题