zoukankan      html  css  js  c++  java
  • html button 点击链接

    <!DOCTYPE html>
    <html>
    
    <head>
    <meta charset="UTF-8">
    <title></title>
    </head>
    
    <body>
    //1.在原来的页面中打开:
    <input type="button" onclick="window.location.href('xxx.cn')"> //IE中使用"location.href='a.html'" firefox中使用
    <a href="b.html"><input type="button" name="test" value="test" /></a>
    //2.打开新的页面:
    <input type="button" onclick="window.open('xxx.cn')"> 3.使用script
    
    <script>
    function btn_onclick() {
    window.location = "home.html";
    }
    </script>
    
    <button class="ui-btn ui-btn-primary" onclick="btn_onclick()">回首页</button>
    </body>
    
    </html>
    

      

  • 相关阅读:
    JSTL和EL
    JSP
    Servlet基础知识
    JSON基础知识
    jQuery基础知识
    ajax基础知识
    索引实战
    反射
    设计模式
    JVM的异常处理
  • 原文地址:https://www.cnblogs.com/Oopa/p/5908723.html
Copyright © 2011-2022 走看看