zoukankan      html  css  js  c++  java
  • 如何在select标签中使用a标签跳转页面

    1. 需求: 在select中想直接使用a标签跳转,错误想法
    <select id="">
        <option>choose one</option> <option><a href="https://www.baidu.com">百度</a></option> <option><a href="https://www.qq.com">腾讯</a></option> <option><a href="https://www.360.com">360</a></option> <option><a href="https://http://www.mi.com/">小米</a></option> </select> 

    很遗憾,没有任何效果。

    2.正确解决方案

    <select id="" onchange="window.location=this.value"> <option>choose one</option> <option value="https://www.baidu.com">百度</option> <option value="https://www.qq.com">腾讯</option> <option value="https://www.360.com">360</option> </select> 

    It's OK.




    链接:https://www.jianshu.com/p/6abfe8c7c04d

  • 相关阅读:
    15、编写ORM
    14、细说协程
    COOKIE欺骗
    聪明的小羊
    re.S函数 python3
    截断上传
    sql百态01-post
    Why not?
    随机字符的本地爆破
    HTTP协议-请求头,响应头
  • 原文地址:https://www.cnblogs.com/lxwphp/p/15453740.html
Copyright © 2011-2022 走看看