所以我想知道如何将这个示例中的目标“google-iframe”添加到 iframe 的源链接中。
这是我拥有的当前代码:
<!-- CSS -->
<style>
body {
color: purple;
background-color: #663300 }
</style>
<form target="google-iframe">
<input id="search" type="text"/>
<input type="image" onclick="google-iframe" src="Searchbutton.png" alt="Search Button" height="20" width="20">
<iframe id="google-iframe" src="http://www.google.com/custom?q=" width="250" height="600" onmouseover="width=400" onmouseout="width=250" onclick="window.location='http://www.google.com/custom?q=Test&btnG=Search'"></iframe>
</form>
我希望它是这样的:
<iframe id="google-iframe" src="http://www.google.com/custom?q=" + "google-iframe" width="250" height="600" onmouseover="width=400" onmouseout="width=250" onclick="window.location='http://www.google.com/custom?q=Test&btnG=Search'"></iframe>
变化是它说
src=http://www.google.com/custome?q=
曾经被定义为“google-iframe”的内容将被插入到 src 的末尾,例如
src=http://www.google.com/custome?q=WhatEverIsEntedInTheGoogle-Iframe