简体   繁体   English

手动设置 web 页面链接

[英]manually set up web page link

Is there in HTML,CSS or javascript some command or code with which i can change web link from C:/Users/42191/Desktop/googlepage/generator.html to idk whatever i want like www.google.com? Is there in HTML,CSS or javascript some command or code with which i can change web link from C:/Users/42191/Desktop/googlepage/generator.html to idk whatever i want like www.google.com? Thanks for advices!感谢您的建议! 由此

对此

You can do it in javascript in this way你可以这样在javascript

    document.getElementById("myLink").onclick = function() {

        if(document.getElementById("abc").href == 
            "C:/Users/42191/Desktop/googlepage/generator.html")
        document.getElementById("abc").href="www.google.com"; 
    }
<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="refresh" content="5; url='https://www.google.com'" />
  </head>
  <body>
    <p>Please click <a href="https://www.google.com">this link to direct now</a>.</p>
  </body>
</html>

Change 5 if you wish to redirect in less time.如果您希望在更短的时间内重定向,请更改 5。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM