Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用JavaScript实现指向已存在按钮的URL链接&;HTML?_Javascript_Html - Fatal编程技术网

如何使用JavaScript实现指向已存在按钮的URL链接&;HTML?

如何使用JavaScript实现指向已存在按钮的URL链接&;HTML?,javascript,html,Javascript,Html,我在SharePoint页面上有以下内容: <a href="#top" onmouseover="document.getElementById('myimage6').src='LOCATION OF BUTTON IMAGE';" onmouseout="document.getElementById('myimage6').src='LOCATION OF BUTTON IMAGE';" > <img src="LOCATION OF BUTTON IMAG

我在SharePoint页面上有以下内容:

<a href="#top"

onmouseover="document.getElementById('myimage6').src='LOCATION OF BUTTON IMAGE';"
onmouseout="document.getElementById('myimage6').src='LOCATION OF BUTTON IMAGE';" >

    <img src="LOCATION OF BUTTON IMAGE" id="myimage6" />

</a>

这适用于鼠标悬停的按钮,但当然,当我点击它时,它没有任何作用。有人可以修改上面的按钮,让它转到google.com或其他网站吗

我很抱歉可能没有使用正确的代码阻塞,但我不太清楚。我已经在开始和结束时删除了a和/a周围的标记

谢谢


C

这是一个超链接-您只需将所需目标放在
href
属性中:

<a href="http://www.google.com">I go to google</a>

需要

href="http://www.google.co.uk"
你是说像这样吗

<a href="http://www.google.com"> GO TO GOOGLE </a>

@Bongs我不知道你在说什么。这是100%正确的
<a href="http://www.google.com"> GO TO GOOGLE </a>