所以如标题所述,这是可能的吗?我尝试了几种方法,但没有任何效果。我尝试的最后一段代码使按钮上的文本有下划线,所以我想做的是 如标题所述 + 没有使按钮内的文本带有下划线。
谢谢你
编辑 : 由于看起来不够清楚,所以是这样的 我有三个 HTML 页面 让我们说 index.html、*list.html* 和 judul.html
-list.html的HTML代码
<pre><code><html>
<head>
<title>List</title>
</head>
<body>
<form action="new 2.html" target="tengah">
<input type="submit" value="About Us">
</form>
</body>
</html>
</code></pre>
-然后index.html
<pre><code><html>
<head>
<title>Frame</title>
</head>
<frameset rows="20%,80%" bordercolor='blue' noresize id="judul">
<frame src="Judul.html" id="atas">
<frameset cols="15%,85%" id="kolom">
<frame src="list.html" id="daftar">
<frame src="" id="tengah">
</frameset>
</frameset>
</html>
</code></pre>
最后一个 judul.html 不包括在内,因为它设置了其他元素,例如行的大小或根据条件应显示的内容。 所以我真正想做的是 在 list.html 上创建一个链接到其他页面的按钮,但将其显示到 ID 为 tengah 的框架 这样就可以了吗?
最佳答案
你可以这样做:
<button id="btn">Button</button>
<iframe id="frame"></iframe>
使用 JS:
var btn = document.getElementById("btn");
var frame = document.getElementById("frame");
btn.addEventListener("click", function()
{
frame.src = 'http://url.com/';
});
关于html - 可以使按钮充当超链接或其他类似按钮,但针对另一个框架? (HTML),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20537494/