zoukankan      html  css  js  c++  java
  • 最简单的省市区级联

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

    <html>
    <head>
    <title>最简单的省市县级联</title>
    <script type="text/javascript" src="../Region.js"></script>
    </head>

    <body>

    <span>*</span> 省
    <select id="sel_Province" style="80px" name="sel_Province">
    </select>
    <span>*</span> 市
    <select id="sel_City" name="sel_City">
    </select>
    <span>*</span> 县/区
    <select id="sel_County" name="sel_County">
    </select>

    <script>
    AreaSelector().init();

    function getValue(id)
    {
    var sel = document.getElementById(id);
    if (sel && sel.options)
    {
    alert(sel.options[sel.selectedIndex].value);
    }
    }

    function getText(id)
    {
    var sel = document.getElementById(id);
    if (sel && sel.options)
    {
    alert(sel.options[sel.selectedIndex].text);
    }
    }
    </script>
    <br><br>
    <input type="button" value="省选项值" onclick="getValue('sel_Province')" />
    <input type="button" value="省选项文本" onclick="getText('sel_Province')" />

    <input type="button" value="市选项值" onclick="getValue('sel_City')" />
    <input type="button" value="市选项文本" onclick="getText('sel_City')" />

    <input type="button" value="县/区选项值" onclick="getValue('sel_County')" />
    <input type="button" value="县/区选项文本" onclick="getText('sel_County')" />
    </body>
    </html>

  • 相关阅读:
    修改VNC的分辨率
    How to use WinSCP with public key authentication
    CentOS-7-x86_64-DVD-1511.iso
    6.828
    Tampermonkey版Vimium
    servlet+jsp完成简单登录
    Servlet知识点小结
    HTTP基础知识点小结
    LeetCode 371两数之和
    LeetCode53 最大子序列问题
  • 原文地址:https://www.cnblogs.com/youxianyen/p/6027012.html
Copyright © 2011-2022 走看看