<a href=""> link using the URL as a label

时间:2018-05-13 10:56:06

标签: html5

Is it possible to create a hyperlink using a variable so rather than type in text like CLICK HERE it will display the full URL of the page that is in the a href tag no matter what the URL is ???

< a href="http://sourceforge.net/projects/tcpick/,">CLICK HERE< /a >
<br>Such as:<br>
< a href="http://sourceforge.net/projects/tcpick/,">$0< /a ><br>

So http://sourceforge.net/projects/tcpick/将在页面上

1 个答案:

答案 0 :(得分:0)

我已经创建了一些javascript代码,可以实现这一目标。

for(var v = 0; v < document.links.length; v++)
if(document.links[v].innerHTML === "$0") document.links[v].innerHTML = document.links[v].href;

我希望你会满意。